a,n = map(int,input().split()) m = 2**24 n %= m print(m) print((a**n)%m)