a=input("").split()
b=[]
for c in a:
    c=int(c)
    b.append(c)
x=b[0]
y=b[1]
print(pow(x,y))
print(pow(y,x))