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