import sys

x,y=map(int,input().split())
print(pow(x,y),pow(y,x),sep="\n")