#include long long mpow(int mx, long long ma){ if(ma==1){return mx;} if(ma==0){return 1;} if(ma%2==1){ return mx * mpow(mx, ma-1) % 1000003; }else{ return mpow(mx, ma/2) * mpow(mx, ma/2) % 1000003; } } int main(void){ int i, x, N; scanf("%d %d", &x, &N); long long t = 0, a; for(i=0;i