#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;

const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint operator-() const {return mint(-x);}
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const{
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const{
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const{
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const{
    if(!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if(t&1) a*= *this;
    return a;
  }

  // prime mod
  mint inv() const {return pow(mod-2);}
  mint& operator/=(const mint a){return (*this) *= a.inv();}
  mint operator/(const mint a) const{
    mint res(*this);
    return res/=a;
  }
};
istream& operator>>(istream& is, mint& a){return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a){return os << a.x;}

mint f(int n){
  if(n < 0) return 0;
  return mint(n)*(n+1)/2;
}

mint c(int n){
  if(n < 0) return 0;
  return f(n) * f(n);
}

int main(){
  ll t;
  cin >> t;
  rep(i,t){
    int n, a, b;
    cin >> n >> a >> b;
    mint x = f(n-a-b+1)*(n-b+1)*(n-a+1);
    mint y = c(n-a-b+1);
    cout << x * 4 - y * 4 << endl;
  }

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
int main(){
    int t;
    cin>>t;
    while(t--){
        ll a,b,c,ans=0;
        cin>>a>>b>>c;
        if(a>=b+c){
            ll res=(a-b-c+1)*(a-b-c+2)%mod;
            ll num=2*(a-b+1)*(a-c+1)%mod-res;
            if(num<0) num=(mod-(-num)%mod)%mod;
            ans=res*num%mod;
        }
        cout<<ans<<endl;
    }
}


