快速幂模板
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <map>
#include <stack>
#define maxn 500050
#define INF 0x3f3f3f
using namespace std;
typedef long long ll;
const int mod = 9901;
int a, b;
int main()
{
while(cin >> a >> b)
{
int ans = 1 % mod;
while(b)
{
if(b & 1)
ans = ans % mod * a % mod;
a = a % mod * a % mod;
b >>= 1;
}
cout << ans << endl;
}
return 0;
}