#include<bits/stdc++.h> #define re register #define int long long #define Add(a,b) (((a) % mod + (b) % mod) % mod) #define Mul(a,b) (((a) % mod) * ((b) % mod) % mod)
usingnamespace std;
constint N = 1e7 + 10,M = 1e4 + 10,mod = 998244353; int n,d,ans; int fac[M],inv[M];
structmat{ int n,m; int mt[5][5];
mat(int a,int b){ n = a; m = b; memset(mt,0,sizeof(mt)); }
mat friendoperator *(const mat &a,const mat &b){ mat t(a.m,b.m); for (re int i = 1;i <= a.n;i++){ for (re int j = 1;j <= b.m;j++){ for (re int k = 1;k <= a.m;k++) t.mt[i][j] = Add(t.mt[i][j],Mul(a.mt[i][k],b.mt[k][j])); } } return t; } }base(2,2),dp(1,2);
inlineintread(){ int r = 0,w = 1; char c = getchar(); while (c < '0' || c > '9'){ if (c == '-') w = -1; c = getchar(); } while (c >= '0' && c <= '9'){ r = (r << 3) + (r << 1) + (c ^ 48); c = getchar(); } return r * w; }
inlineintqmival(int a,int b){ int res = 1; while (b){ if (b & 1) res = Mul(res,a); a = Mul(a,a); b >>= 1; } return res; }
inline mat qmi(mat a,int b){ mat c(a.n,a.n); for (re int i = 1;i <= c.n;i++) c.mt[i][i] = 1; while (b){ if (b & 1) c = c * a; a = a * a; b >>= 1; } return c; }
inlinevoidinit(){ fac[0] = 1; for (re int i = 1;i <= d;i++) fac[i] = Mul(fac[i - 1],i); inv[d] = qmival(fac[d],mod - 2); for (re int i = d - 1;~i;i--) inv[i] = Mul(inv[i + 1],i + 1); }
inlineintC(int n,int m){ if (n < m || m < 0) return0; returnMul(fac[n],Mul(inv[n - m],inv[m])); }