#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; unsigned long long mod=1000003; //a^b unsigned long long mod_pow(unsigned long long a,unsigned long long b){ unsigned long long res=1; while(b>0){ if((b&1)==1) res=(res*a)%mod; b >>=1; a=(a*a)%mod; } return res; } int main() { unsigned long long x; int n; cin>>x>>n; unsigned long long res=0; for(int i=0;i>a; res+=mod_pow(x,a); res%=mod; } cout<