from math import ceil N = int(input()) print((6**ceil((N-1)/2)+N%2)%998244353)