#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; class nCombP { public: long long ModP; std::vector fact_; std::vector factr_; nCombP(int maxN, long long P) : ModP(P) { std::vector inv(maxN+1, 0); fact_.resize(maxN+1,0); factr_.resize(maxN+1,0); inv[1] = fact_[0] = factr_[0] = 1; for (int i = 2; i <= maxN; ++i) inv[i] = inv[ModP % i] * (ModP - ModP/i) % ModP; for (int i = 1; i <= maxN; ++i) { fact_[i] = fact_[i-1]*i % ModP; factr_[i] = factr_[i-1]*inv[i] % ModP; } } long long operator()(long long n, long long r) { if (r < 0 || r > n) return 0; return (fact_[n] * factr_[r] % ModP) * factr_[n-r] % ModP; } }; class CombinationNumber { public: void solve(void) { const int Mod = (int)(1e+9)+7; const int maxN = (int)1e+6; // O(maxN) nCombP nCr(maxN,Mod); int T; cin>>T; REP(_, T) { char type, a,b,c; int n,k; cin>>type>>a>>n>>b>>k>>a; (void)a; (void)b; (void)c; switch (type) { case 'C': cout<solve(); delete obj; return 0; } #endif