#include<bits/stdc++.h>
#define pb push_back
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define f first
#define s second
#define int long long
#define sz(x) (ll)(x.size())
using namespace std;


const int mod = 1e9+7;

int expo_pow(int x,int y){
 if(y == 0) return 1;
  y=y%(mod-1);
  x%=mod;
  if(y==0) y=mod-1;
  int res=1;
  while(y){
    if(y&1) res=(res*x)%mod;
    x=(x*x)%mod;
    y>>=1; 
  }
  return res;
}

ll add()
{
    return 0;
}

template <typename T, typename... Types>
T add(T var1, Types... var2){
    return (((((ll)(var1)) % mod + (ll)(add(var2...))) % mod) + mod) % mod;
}

ll mul(){
    return 1;
}

template <typename T, typename... Types>
T mul(T var1, Types... var2){
    return (((ll)(var1)) % mod * (ll)(mul(var2...))) % mod;
}

void solve(){
  int n,a,b;
  cin >> n >> a >> b;

  int x4;
  if (n -a -b <0) x4 = 0;
  else {
    x4 = (n-a-b+2)*(n-a-b+1)/2;
  }
  x4 %= mod;
  int x3 = 2*x4;
  x3 %= mod;
  int x2 = (mul((n-a+1),(n-b+1)) - x3 + mod) %mod;
  int x1 = x2*x2;
  x1 %= mod;
  int ans = ((mul((n-a+1),(n-a+1),(n-b+1),(n-b+1)) - x1)%mod + mod )%mod;
  cout << ans << "\n";


}


signed main(){
  fast;
  int test = 1;
  cin>>test;
  int i=1;
  while(test--){
    solve();
  }
}




#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long int;
const ll MOD = 1000000007;

int main(){
    int t;
    cin >> t;
    for(int i = 0; i < t; i++){
        ll n, a, b;
        cin >> n >> a >> b;
        if(n < a+b){
            cout << 0 << endl;
            continue;
        }
        ll ans = (((n-a+1)%MOD)*((n-a+1)%MOD))%MOD;
        ans *= (((n-b+1)%MOD)*((n-b+1)%MOD))%MOD;
        ans %= MOD;
        ll x = (((n-a+1)%MOD)*((n-b+1)%MOD))%MOD;
        x -= (((n-a-b+2+MOD*2)%MOD)*((n-a-b+1+MOD*2)%MOD))%MOD;
        while(x < 0) x += MOD;
        x %= MOD;
        x *= x;
        x %= MOD;
        ans -= x;
        while(ans < 0) ans += MOD;
        cout << ans%MOD << endl;
    }
    return 0;
}