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