def c(x,n): if n==0: return 1 K=1 while n>1: if n%2!=0: K*=x x*=x n//=2 return K*x M=998244353 a,n=map(int,input().split()) print(f'{M}\n{c(a,n)}')