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