//GIVE ME AC!!!!!!!!!!!!!!!!! //#pragma GCC target("avx") //#pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") #include #define ll long long #define ld long double #define floatset() fixed<; using vi=vector; using vs=vector; using vc=vector; using vvl=vector; using P=pair; using vvc=vector; using vd=vector; using vp=vector

; using vb=vector; const int dx[8]={1,0,-1,0,1,-1,-1,1}; const int dy[8]={0,1,0,-1,1,1,-1,-1}; const ll inf=2e18; const ll MOD=1000000007; const ll mod=998244353; const double pi=acos(-1); template ostream &operator<<(ostream&os,const pair&p) { os< istream &operator>>(istream&is,pair&p) { is>>p.first>>p.second; return is; } template ostream &operator<<(ostream&os,const vector&v) { for(int i=0;i<(int)v.size();i++) { os< istream &operator>>(istream&is,vector&v) { for(T &in:v)is>>in; return is; } void scan(){} template void scan(Head&head,Tail&... tail) { cin>>head; scan(tail...); } template void print(const T &t) { cout << t << '\n'; } template void print(const Head &head, const Tail &... tail) { cout << head << ' '; print(tail...); } template void fin(const T &... a) { print(a...); exit(0); } template ll sum_(vector&v){ ll res=0; for(auto &e:v)res+=e; return res; } template inline bool chmax(T1&a,T2 b){return a inline bool chmin(T1&a,T2 b){return a>b&&(a=b,true);} template struct modint{ long long x; modint():x(0){} modint(long long y):x(y>=0?y%m:(m-(-y)%m)%m){} modint inv()const{long long a=x,b=m,u=1,v=0,t; while(b){ t=a/b; swap(a-=t*b,b); swap(u-=t*v,v); } return modint(u); } modint &operator+=(const modint&p) {if((x+=p.x)>=m)x-=m;return *this;} modint &operator-=(const modint&p){if((x+=m-p.x)>=m)x-=m;return *this;} modint &operator*=(const modint&p) {x=x*p.x%m;return *this;} modint &operator/=(const modint&p){*this*=p.inv();return *this;} modint operator-()const{return modint(-x); } modint operator+(const modint&p)const{return modint(*this)+=p; } modint operator-(const modint&p)const{return modint(*this)-=p; } modint operator*(const modint&p)const{return modint(*this)*=p; } modint operator/(const modint&p)const{return modint(*this)/=p; } bool operator==(const modint&p)const{return x==p.x;} bool operator!=(const modint&p)const{return x!=p.x;} modint pow(long long n) const { modint ret(1),mul(x); while(n){ if(n&1)ret*=mul; mul*=mul; n>>=1; } return ret; } friend ostream &operator<<(ostream &os,const modint&p) { return os<>(istream &is, modint &a) { long long t; is>>t; a=modint(t); return (is); } static long long get_mod(){return m;} }; template struct combination{ using mint=modint; vectordat,idat; long long mx; combination(long long mx_=300000):dat(mx_+1,1),idat(mx_+1,1),mx(mx_){ for(long long i=1;i<=mx;i++)dat[i]=dat[i-1]*mint(i); idat[mx]/=dat[mx]; for(long long i=mx;i>0;i--)idat[i-1]=idat[i]*mint(i); } mint com(long long n,long long k){ if(n<0||k<0||ncomb(2500000); while(t--){ CHR(c); char a; ll n,k; cin>>a>>n>>a>>k>>a; if(c=='C')print(comb.com(n,k)); if(c=='P')print(comb.P(n,k)); if(c=='H')print(comb.H(n,k)); } }