#include using namespace std; const int mod=998244353; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; long long ans=1,t=3; for(int i=0;i<30;i++){ if(N>>i&1)ans=ans*t%mod; t=t*t%mod; } cout<