#include using namespace std; int main () { int N; cin >> N; long long ans = 1; long long x = 3; long long m = 998244353; while (N) { if (N & 1) { ans = (ans * x) % m; } N >>= 1; x = (x * x) % m; } cout << ans << endl; }