#include using namespace std; #include using namespace atcoder; using ll=long long; #define MOD 998244353 using Graph=vector>>; #define INF 1000000000 #define MAX 200000 vector> multi(vector> a,vector> b){ int n=a.size(); int m=b[0].size(); int l=b.size(); vector> ret(n,vector(m,0)); for(int i=0;i> powMatrix(vector> a,ll x){ int n=a.size(); vector> ret(n,vector(n,0)); for(int i=0;i0){ if(x%2==1){ ret=multi(a,ret); } a=multi(a,a); x>>=1; } return ret; } int main(){ ll n; cin>>n; //偶数 if(n%2==0){ vector> a(2,vector(2,1)); a[1][1]=0; vector> b(2,vector(1,1)); //cout<> a(4,vector(4,0)); a[0][0]=1; a[0][1]=1; a[1][0]=1; a[0][2]=2; a[2][2]=1; a[2][3]=1; a[3][2]=1; vector> b(4,vector(1,0)); b[0][0]=0; b[1][0]=0; b[2][0]=1; b[3][0]=0; auto ret=multi(powMatrix(a,(n+1)/2),b); ll ans=(ret[1][0]+ret[3][0])%MOD; cout<