#include long p(long x,long n) { long r; if(1>n)return 1; r=p(x*x%1000003,n/2); if(n%2)r=r*x%1000003; return r; } int main(void) { long x,n,a,s=0,i; scanf("%ld%ld",&x,&n); for(i=0;i