a, n = map(int, input().split()) m = 10 ** 8 print(m) print(pow(a, n, m))