#include<bits/stdc++.h>

typedef long long ll;
typedef long double ld;
using namespace std;
//mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 mrand(42);
#define ii for(int i=1;i<=n;++i)
#define ji for(int j=1;j<=n;++j)
#define jj for(int j=1;j<=m;++j)
#define ij for(int i=1;i<=m;++i)
#define sz(x) ((ll)x.size())
#define all(x) x.begin(),x.end()
#define al(x) x+1,x+1+n
#define asd cout<<"ok"<<endl;
#define asdd cout<<"okok"<<endl;
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define pr(v) for(auto i:v) cout<<i<<" ";cout<<endl;
#define prt(a, l, r) for(auto i=l;i<=r;++i) cout<<a[i]<<" ";cout<<endl;
#define pc(x) __builtin_popcount(x)
#define pb push_back
#define PS string qqwwee;cin>>qqwwee;
typedef pair<int,int> pii;

const int mod = 1e9+7;
ll get(ll a1,ll d1,ll n) {
    a1%=mod;d1%=mod;n%=mod;
    return ((a1+(n-1)*d1%mod-(n-1)*(n-2)%mod)%mod+mod)%mod;
}
ll solve(ll n,ll a,ll b) {
    ll a1=get(n,n-2,a),d1=b;
    return get(a1,n-2-a+1,b);
}
int main() {
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--) {
        ll n,a,b;
        cin>>n>>a>>b;
        if(a+b>n) {cout<<0<<endl;continue;}
        ll ans=solve(n,a,b);
        ans=ans*ans%mod;
        ll tot=(n-a+1)*(n-a+1)%mod*(n-b+1)%mod*(n-b+1)%mod;
        ans=(tot-ans+mod)%mod;
        cout<<ans<<endl;
    }
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define vec2(name,i,j,k) vector<vector<ll>> name(i,vector<ll>(j,k))
#define vec3(name,i,j,k,l) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k,l)))
#define pb push_back
#define MOD 1000000007
#define PI 3.141592653
#define INF 100000000000000 //14
//cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

void solve() {
  ll n, a, b; cin >> n >> a >> b;
  if (a<b) swap(a,b);
  if (n<a+b){
    cout << 0 << endl;
    return;
  }
  ll x = ((n-a-b+1)*(n-a-b+2)/2)%MOD;
  ll z; 
  if (n-a>=b) {
    z=(((b-1)*b/2)%MOD+((n-a-b+1)*(b-1))%MOD)%MOD;
  }
  else {
    z=((n-a)*(n-a+1)/2)%MOD;
  }
  ll y = (((a-b+1)*(n-a+1))%MOD+(2*z%MOD))%MOD;
  ll ans = (((4*x)%MOD)*((x+y)%MOD))%MOD;
  cout << ans << endl;
}

int main(){
  ll t; cin >> t;
  REP(i,t) {
    solve();
  }
  return 0;
}