a, n = map(int, input().split()) m = 998244353 print(m) print(pow(a, n, m))