a, n = list(map(int, input().split())) print(pow(a, n) % 100000000)