mod=998244353 t=int(input()) for i in range(t): n=int(input()) n-=1 ans=2 for j in range(n): ans*=3 ans%=mod print(ans)