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