import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner cin = new Scanner(System.in);
while(cin.hasNext()){
int n = cin.nextInt();
int m = cin.nextInt();
int ans = pow(n,m);
System.out.println(ans);
}
}
static int pow(int a,int b){
int r=1,base=a;
while(b!=0){
if((b&1)!=0) r*=base;
base*=base;
b>>=1;
}
return r;
}
}
快速幂取模:
ULL Quick_Pow(ULL a,ULL b,int m)
{
ULL ans = 1;
while(b){
if(b&1) ans = (ans%m)*(a%m)%m;
a = (a%m)*(a%m)%m;
b>>=1;
}
return ans;
}