#include #include #include #include using namespace std; #define REP(i,s,e) for (i = s; i <= e; i++) #define rep(i,n) REP (i,0,(int)(n)-1) #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP (i,(int)(n)-1,0) #define INF (int)1e8 #define MOD 129402307 typedef long long ll; int main(void) { string N, M; cin >> N >> M; ll n = 0, m = 0; int i; rep (i,N.size()) n = (n * 10 + N[i] - '0') % MOD; rep (i,M.size()) m = (m * 10 + M[i] - '0') % (MOD-1); ll ans = 1; while (m) { if (m % 2) { ans *= n; ans %= MOD; } n *= n; n %= MOD; m /= 2; } cout << ans << endl; return 0; }