a,n=map(int,input().split()) S=0 A=1 while A<10000000: A*=a S+=1 print(A) if S>n: print(a**n) else: print(0)