#include<bits/stdc++.h>
#define ll long long
#define r(i,a,b) for(register int i=a;i<=b;i++)
#define mem(d) memset(d,0,sizeof(d))
#define ul unsigned long long
#define IsDigit(c) ('0' <= (c) && (c) <= '9')
const int N=500000;
const ll p=1e9+7;
using namespace std;
inline ll qr()
{
	int x = 0; bool f = true;char c = getchar();
	for (; ! IsDigit(c); c = getchar()) if (c == '-') f = false;
	for (; IsDigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ '0');
	return f ? x : -x;
}
ll res,num,n,a,b,ans;
int main()
{
    int T;
    T=qr();
    while(T--)
	{
        ans=0;n=qr(),a=qr(),b=qr(); 
        if(n>=a+b)
		{
            res=((n-a-b+1) * (n-a-b+2) )%p;
            num=(2*(n-a+1) * (n-b + 1))%p-res;
            if(num<0) 
				num=(p-(-num) )%p;//处理负数 
            ans=res*num%p;
        }
        printf("%lld\n",ans);
    }
}
#include<iostream>
using namespace std;
typedef long long li;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

struct modint{
  li num;

  modint(li a=0){
    num=(a%MOD+MOD)%MOD;
  }
  modint operator+(modint a) {return{(num+a.num)%MOD};} 
  modint operator-(modint a) {return{(num+MOD-a.num)%MOD};}
  modint operator*(modint a) {return{num*a.num%MOD};}
  modint inv(const modint& a);
  modint operator/(modint a) {return (*this)*inv(a);}
  modint& operator+=(modint a) {
    (num += a.num)%=MOD;
    return *this;
  }
  modint& operator-=(modint a) {
    (num += MOD-a.num)%=MOD;
    return *this;
  }
  modint& operator*=(modint a) {
    (num*=a.num)%=MOD;
    return *this;
  }
};

std::ostream& operator<<(std::ostream& os, const modint& m){
  // ここでストリームに obj を書き込みます。
  li a=m.num;
  cout << a;
  return os;
}

std::istream& operator>>(std::istream& os,modint& m){
  // ここでストリームに obj を書き込みます。
  li a; cin >>a;
  m=a;
  return os;
}


int main(){
  int q; cin >>q;
  rep(_,q){
    modint n,a,b; cin >>n >>a >>b;
    if(a.num+b.num>n.num){
      print(0); continue;
    }
    if(a.num>b.num){
      a+=b; b=a-b; a-=b;
    }
    modint ans=(n-b+1)*(a+b-1)-(a-1)*a;
    ans=ans*ans;
    ans*=-1;
    ans+=(n-a+1)*(n-b+1)*(n-a+1)*(n-b+1);
    print(ans);
  }
}
