M=998244353 a,n=map(int,input().split()) b=1 exec('b*=a%M;b%=M;'*n) print(f'{M}\n{b}')