#include #define int long long #define poly basic_string using namespace std; const int N=65,M=1e5+5,Mod=998244353,INV2=499122177; int n,p1,p2,p3,p4,p5,pw2[N],pw3[N],g,invg,w2,w3,ans,a[M],b[M],c[M]; poly P[N][N],Q[N][N],R[N][N],S[N],T[N],F[N],G[N],H[N],W0[N],W1[N],now={{1,0}}; int ksm(int x,int y) { int ret=1,bace=x; while(y) { if(y&1)ret=ret*bace%Mod; bace=bace*bace%Mod; y>>=1; } return ret; } namespace NTT { typedef long long LL; typedef vector PN; const int maxn=1000000,maxt=1<<21,MOD=998244353; int te,Q,A,B,P,a[maxn+5]; int pw[maxn+5],INV[maxn+5],fac[maxn+5]; int wn[maxt+5],temA[maxt+5],temB[maxt+5]; inline int ADD(int x,int y) {return x+y>=MOD?x+y-MOD:x+y;} inline int MUL(int x,int y) {return (LL)x*y%MOD;} int Pow(int w,int b) {int s;for (s=1;b;b>>=1,w=MUL(w,w)) if (b&1) s=MUL(s,w);return s;} __attribute__((constructor)) void NTTPre(){ int x=Pow(3,(MOD-1)/maxt); wn[maxt>>1]=1; for (int i=(maxt>>1)+1;i>1)-1;i;i--) wn[i]=wn[i<<1]; } void NTT(int *a,int n,int f){ if (f>0){ for (int k=n>>1;k;k>>=1) for (int i=0;i