#include<bits/stdc++.h>
using namespace std;
const ll MOD=1000000007;
int n,a,b,ans;
vector<int>t;
int cnt;
void dfsans(int u,vector<int>v,vector<int>c){
if(u==n){
int sca=0,scb=0;
for(int i=0;i<n;i++){
if(c[i]>v[i])sca++;
else if(v[i]>c[i])scb++;
}
if(sca==a&&scb==b){
ans++;
ans%=MOD;
// Sleep(500);
}
return;
}
for(int i=1;i<=n;i++){
vector<int>::iterator it=find(v.begin(),v.end(),i);
if(it==v.end()){
v.push_back(i);
dfsans(u+1,v,c);
v.pop_back();
}
}
}
void dfs(int u,vector<int>v){
if(u==n){
dfsans(0,t,v);
}
for(int i=1;i<=n;i++){
vector<int>::iterator it=find(v.begin(),v.end(),i);
if(it==v.end()){
v.push_back(i);
dfs(u+1,v);
v.pop_back();
}
}
}
int main(){
int Q;cin>>Q;
while(Q--){
cin>>n>>a>>b;
dfs(0,t);
cout<<ans<<endl;
ans=0;
}
// cout<<a00<<" "<<a11<<" "<<a12<<" "<<a13<<" "<<a21<<" "<<a22<<" "<<a31<<endl;
}