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