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