N = int(input())
if N%2==0:
    M = int(N/2)
else:
    M = int((N-1)/2)
a = 1
for i in range(M):
    a = (6*a)%998244353

print(a)