#include #include #include #include #include #include #include #include #include #include static const int MOD = 129402307; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max() / 32 * 15 + 208; template T pow_ (T x, T n, T M){ uint64_t u = 1, xx = x; if(x == 0) return 0; while (n > 0){ if (n&1) u = u * xx % M; xx = xx * xx % M; n >>= 1; } return static_cast(u); }; int main() { string s, t; cin >> s >> t; int n = 0, m = 0; if(t == "0") { puts("1"); return 0; } for(auto &&i : s){ n = (n*10 + i - '0')%MOD; } for(auto &&i : t){ m = (m*10 + i - '0')%(MOD-1); } cout << pow_(n, m, MOD) << "\n"; return 0; }