x, y = map(int, input().split())

print(x ** y)
print(pow(y, x))