#41910: python解


chenwei980503@gmail.com (陳維(Z))


while True:
n, m=map(int, input().split())
if n==0 and m==0:
break
print(pow(n, m)) # n的m次方