N = int(input()) N = N-1 if N%2 else N print(pow(6,N//2,998244353))