n = int(input()) for i in range(n): print([998244353, 4][int(input()) % 2])