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