//Date: 2025-02-08 09:39:47 #include using namespace std; #define ll long long #define P emplace_back #define CLEAR(a,v) memset(a,(v),sizeof(a)) #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) //char buf[1<<20],*p1,*p2; //#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++) inline int rd() { int s=0,m=0;char ch=getchar(); while(!isdigit(ch)) {if(ch=='-')m=1;ch=getchar();} while( isdigit(ch)) s=(s<<3)+(s<<1)+(ch^48),ch=getchar(); return m?-s:s; } bool MBE; namespace SOLVER { #define ldb long double const int N=4e6,M=1e9+7;const ldb pi=acosl(-1); int qpow(int x,int y=M-2) {int s=1;for(;y;y>>=1,x=1ll*x*x%M) if(y&1) s=1ll*s*x%M;return s;} int rv[7000005]; int init(int n) { int nn=1,k=0;while(nn<=n) nn<<=1,k++; for(int i=0;i<(1<>1]>>1)|((i&1)<<(k-1));return nn; } #define cp complex void fft(cp f[],int n,int fl) { cp x,y;rep(i,0,n-1) if(i>x>>y>>z;if(!x&&!y&&!z) {puts("1");return;} fac[0]=1;rep(i,1,N) fac[i]=1ll*fac[i-1]*i%M;ifac[N]=qpow(fac[N]);per(i,N,1) ifac[i-1]=1ll*ifac[i]*i%M; rep(i,0,x+y+z) a[i]={(i%2?M-ifac[i]:ifac[i]),0},b[i]={1ll*C(x+i-1,i-1)*C(y+i-1,i-1)%M*C(z+i-1,i-1)%M*ifac[i]%M,0}; // rep(i,0,x+y+z) cout<<(int)a[i].real()<<' ';cout<