#pow() **
a=list(map(int,input().split()))
print(pow(a[0], a[1]), pow(a[1], a[0]), sep='\n')