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