#include
int my_pow(int a,int n)
{
int i;
int res=1;
for(i=0;i
res = res*a%1000;
}
return res;
}
int main()
{
int a,n;
while(scanf("%d%d",&a,&n)!=EOF)
{
printf("The last 3 numbers is ");
int res=my_pow(a,n);
if(res!=0)
{
printf("%d\n",res);
}
else
{
printf("000\n");
}
}
return 0;
}
X%1000 是对1000取余