prnt(3**(int(input()))%998244353)