#include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>

using ll = long long;
using vll = std::vector<ll>;
using namespace std;
#define REP(i, x, n) for(int i = x; i < (n); i++)
#define rep(i, n) REP(i, 0, n)
template<class T> void gi(T &x){
  int minus=0; x=0; char c=getchar();
  for(;c<'0'||c>'9'; c=getchar()) minus|=(c=='-');
  for(;c>='0'&&c<='9'; c=getchar()) x=(x<<1)+(x<<3)+(c^48);
  if(minus) x=-x;
}
const ll MOD=1000000007;
int main() {
  ll t; gi(t);
  auto square = [](ll n, ll md){
    return n*n%md;
  };
  auto choose2 = [](ll n, ll md){
    return n*(n-1)/2%md;
  };
  rep(i,t){
    ll n,a,b; gi(n),gi(a),gi(b);
    if(a+b > n){
      printf("%lld\n", 0LL);
      continue;
    }
    ll all = (square(n-a+1,MOD)*square(n-b+1,MOD))%MOD;
    ll notoverlaped = choose2(n-a-b+2,MOD)*2%MOD;
    ll overlaped = square((((n-a+1)*(n-b+1)%MOD- notoverlaped+MOD)%MOD),MOD);
    ll ans = (all - overlaped +MOD)%MOD;
    printf("%lld\n", ans);
  }
  return 0;
}
#include <bits/stdc++.h>
 
// #include <atcoder/all>
 
using namespace std;
// using namespace atcoder;
 
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}
typedef long long ll;
#define int ll
 
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
// vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
// #define mp make_pair
//#define endl '\n'



signed main() {
    fio();
    int t;
    cin >> t;
    while (t--) {
        ll n, a, b;
        cin >> n >> a >> b;
        if (a + b > n) {
            cout << 0 << endl;
            continue;
        }

        if (a < b) swap(a, b);

        vl kouho;
        kouho.push_back(0);
        kouho.push_back(b);
        kouho.push_back(n - a - b + 1);
        kouho.push_back(n - a + 1);
        sort(all(kouho));
        // UNIQUE(kouho);
        // DEBUG_VEC(kouho);
        ll ans = (n - a + 1) * (n - a + 1) % MOD * (n - b + 1) % MOD * (n - b + 1) % MOD;
        // DEBUG(ans);
        rep (i, 3) {
            rep (j, 3) {
                ll r1 = kouho[i + 1] - kouho[i], r2 = kouho[j + 1] - kouho[j];
                ll add = r1 * r2 % MOD;
                // DEBUG(pll(r1, r2));
                ll s1 = max(0LL, kouho[i] - b + 1), t1 = max(0LL, kouho[j] - b + 1);
                ll s2 = min(kouho[i] + a, n - b + 1), t2 = min(kouho[j] + a, n - b + 1);
                // DEBUG(pll(s1, s2));
                // DEBUG(pll(t1, t2));
                (add *= (s2 - s1) * (t2 - t1) % MOD) %= MOD;
                // DEBUG(add);
                (ans -= add) %= MOD;
            }
        }
        cout << (ans % MOD + MOD) % MOD << endl;
    }
}