#include using namespace std; using ll = long long; const ll mod = 998'244'353; //const ll mod = 1'000'000'007; //const ll mod = 67'280'421'310'721; struct mint{ long long x; mint(long long x=0):x((x%mod+mod)%mod){} mint operator-() const{ return mint(-x); } mint& operator+=(const mint& a){ if((x+=a.x)>=mod)x-=mod; return *this; } mint& operator-=(const mint& a){ if((x+=mod-a.x)>=mod)x-=mod; return *this; } mint& operator*=(const mint& a){ (x *= a.x) %= mod; return *this; } mint operator+(const mint& a) const{ mint res(*this); return res+=a; } mint operator-(const mint& a) const{ mint res(*this); return res-=a; } mint operator*(const mint& a) const{ mint res(*this); return res*=a; } mint pow(long long n) const { assert(0 <= n); mint a = *this, r = 1; while (n) { if (n & 1) r *= a; a *= a; n >>= 1; } return r; } mint inv() const{ return pow(mod-2); } mint& operator/=(const mint& a){ return (*this)*=a.inv(); } mint operator/(const mint& a) const { mint res(*this); return res/=a; } friend ostream& operator<<(ostream& os, const mint& m){ os << m.x; return os; } bool operator==(const mint& a) const { return x == a.x; } bool operator<(const mint& a) const{ return x < a.x; } }; template< typename T1, typename T2 = T1 > struct lazysegtree{ using F1 = function; using F2 = function; using F3 = function; //using FF = function; int n; F1 f1; F2 f2; F3 f3; T1 e1; T2 e2,e3; vector data; vector lazy;//莨晄成繝・・繧ソ vector p;//莨晄成縺ョ繝輔Λ繧ーW /* * n:鬆らせ謨ー * f1:隕∫エ蜷悟」ォ縺ョ貍皮ョ・f2:菴懃畑邏蜷悟」ォ,f3:菴懃畑 * e:蜊倅ス榊・ */ lazysegtree(int _n,F1 f1,F2 f2,F3 f3,T1 e1,T2 e2,T2 e3):f1(f1),f2(f2),f3(f3),e1(e1),e2(e2),e3(e3){ n = 1; while(n<_n) n<<=1; data.assign(2*n,e1); lazy.assign(2*n,e3); p.assign(2*n,0); } void set(int i,T1 x){ data[i+n-1] = x; } void build(){ for(int i = n - 2;i>=0;i--){ data[i] = f1(data[2*i+1],data[2*i+2]); } } void rangeupdate(T2 x,int a,int b,int ni,int l,int r){ update(ni,l,r); if(b<=l||r<=a) return; if(a<=l&&r<=b){ p[ni] = 1; lazy[ni] = f2(x,lazy[ni]); update(ni,l,r); }else{ rangeupdate(x,a,b,2*ni+1,l,(l+r)/2); rangeupdate(x,a,b,2*ni+2,(l+r)/2,r); if(l+1; dat cmp(dat a,dat b){ a.first += b.first; a.second += b.second; return a; } dat c1(mint a,dat b){ b.first += a * b.second; return b; } mint cc(mint a,mint b){ return a + b; } mint fac[2<<17],ifac[2<<17]; int main(){ fac[0] = 1; for(int i = 1;i<2<<17;i++) fac[i] = fac[i-1] * mint(i); for(int i = 0;i<2<<17;i++) ifac[i] = fac[i].inv(); int n; cin>>n; if(n==1){ cout<<0< b(n),c(n); for(int i = 0;i>b[i]>>c[i]; vector d; for(int i = 0;i seg(m,cmp,cc,c1,make_pair(mint(0),mint(0)),mint(0),mint(0)); for(int i = 0;i