a,n = map(int,input().split()) M = 10**8 ans = (a**n) % M print(ans)