M=998244353 a,n=map(int,input().split()) b=1 for i in range(n): b*=a%M b%=M print(f'{M}\n{b}')