a,b=map(int,input().split()) for i in range(b+1): if a**i>10**7: print(a**i) print(0) exit() print(10**7+10) print(a**b)