#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int mod=233333;
LL a,b;
LL qml(LL a,LL b,int mod)
{
LL res=1;
while(b)
{
if(b&1)
{
res=res*a%mod;
}
a=a*a%mod;
b/=2;
}
return res;
}
int main()
{
cin>>a>>b;
int x=qml(a,b,mod)%mod;
cout<<x<<endl;
return 0;
}