a,n = map(int,input().split()) M = 10**18 print(M) print(a**n%M)