a, n = map(int,input().split()) an=a**n if(an<10**18): print(10**18) print(an) else: if(a**(n//2)>10**7): print(10**7) print(((a**(n//2))**2)*(2*(1-n//2)))