答案为\(m^n-m\times(m-1)^{n-1}\)。
#include<cstdio>
#define int long long
const int mod=100003;
int n,m;
int fastpow(int a,int x){
int res=1;
while(x){
if(x&1){
res=1LL*res*a%mod;
}
x>>=1;
a=1LL*a*a%mod;
}
return res;
}
signed main(){
scanf("%lld%lld",&m,&n);
printf("%lld\n",(fastpow(m,n)-m*fastpow(m-1,n-1)%mod+mod)%mod);
return 0;
}