for _ in range(int(input())): n = int(input()) mod = 998244353 print(2 * pow(3, n - 1, mod) % mod)