a,n=map(int,input().split()) for i in range(n): if a**i>10**7: print(a**i) print(0) break else: print(10000000) print(a**n)