#include<bits/stdc++.h>
using namespace std;

//typedef
typedef unsigned int UINT;
typedef unsigned long long ULL;
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> PLL;
typedef tuple<LL, LL, LL> TLL3;
typedef tuple<LL, LL, LL, LL> TLL4;
typedef set<LL, greater<LL> > setdownLL;
#define PQ priority_queue
typedef PQ<LL, vector<LL>, greater<LL> > pqupLL;
//container utill
#define ALL(v) (v).begin(),(v).end()
#define CR [](auto element1, auto element2){return element1>element2;}
#define LB lower_bound
#define UP upper_bound
#define PB push_back
#define MP make_pair
#define MT make_tuple
//constant
#define PI 3.141592653589793

const LL MOD=1000000007;

void solve(LL N, LL A, LL B){
    if(A+B>N){
            cout << 0 << endl;
            return;
        }
        if(A<B) swap(A,B);
        LL ans=0;
        LL val,val2;
        //0
        ans=N-A+1LL;
        ans%=MOD;
        ans*=ans;
        ans%=MOD;
        val2=N-B+1LL;
        val2%=MOD;
        ans*=val2;
        ans%=MOD;
        val2=N-B+1LL;
        val2%=MOD;
        ans*=val2;
        ans%=MOD;
        //1st
        val=N-A+1LL;
        val%=MOD;
        val*=val;
        val%=MOD;
        val2=A-B+1LL;
        val2%=MOD;
        val*=val2;
        val%=MOD;
        val*=val2;
        val%=MOD;
        ans+=(MOD-val);
        ans%=MOD;
        //2nd
        val=((B-1LL)*B)/2LL;
        val%=MOD;
        val2=(B-1LL)*(N-A-B+1LL);
        val2%=MOD;
        val+=val2;
        val%=MOD;
        val2=A-B+1;
        val*=val2;
        val%=MOD;
        val2=N-A+1;
        val2%=MOD;
        val*=val2;
        val%=MOD;
        val*=4LL;
        val%=MOD;
        ans+=(MOD-val);
        ans%=MOD;
        //3rd 1
        val=((B-1LL)*B)/2LL;
        val%=MOD;
        val*=val;
        val%=MOD;
        val*=4LL;
        val%=MOD;
        ans+=(MOD-val);
        ans%=MOD;
        //3rd 2
        val=B-1;
        val%=MOD;
        val2=N-A-B+1;
        val2%=MOD;
        val*=val2;
        val%=MOD;
        val2=B-1;
        val2%=MOD;
        val*=val2;
        val%=MOD;
        val*=B;
        val%=MOD;// 2/2=1
        val*=4LL;
        val%=MOD;
        ans+=(MOD-val);
        ans%=MOD;
        //3rd 3
        val=N-A-B+1;
        val%=MOD;
        val*=val;
        val%=MOD;
        val2=B-1;
        val2%=MOD;
        val*=val2;
        val%=MOD;
        val*=val2;
        val%=MOD;
        val*=4LL;
        val%=MOD;
        ans+=(MOD-val);
        ans%=MOD;
        //output
        cout << ans << endl;
}

int main(){
    LL T;
    cin >> T;
    LL N,A,B;
    LL t;
    for(t=0; t<T; t++){
        cin >> N >> A >> B;
        solve(N,A,B);
    }
    system("pause");
    return 0;
}
// 問題の URL を書いておく
// 

#include <bits/stdc++.h>

using namespace std;

//#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)

#endif

#define rep(i, n) for(int i = 0; i < (int)(n); ++i)

using ll = int64_t;

template<int Mod>
struct MintBase {
  int64_t x; // typedef long long int64_t;
  MintBase(int64_t x=0):x((x%Mod+Mod)%Mod){}
  MintBase operator-() const { return MintBase(-x);}
  MintBase& operator+=(const MintBase a) {
    if ((x += a.x) >= Mod) x -= Mod;
    return *this;
  }
  MintBase& operator-=(const MintBase a) {
    if ((x += Mod-a.x) >= Mod) x -= Mod;
    return *this;
  }
  MintBase& operator*=(const MintBase a) { (x *= a.x) %= Mod; return *this;}
  MintBase operator+(const MintBase a) const { return MintBase(*this) += a;}
  MintBase operator-(const MintBase a) const { return MintBase(*this) -= a;}
  MintBase operator*(const MintBase a) const { return MintBase(*this) *= a;}
  MintBase pow(int64_t t) const {
    if (!t) return 1;
    MintBase a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime Mod
  MintBase inv() const { return pow(Mod-2);}
  MintBase& operator/=(const MintBase a) { return *this *= a.inv();}
  MintBase operator/(const MintBase a) const { return MintBase(*this) /= a;}
};

//const int Mod = 1000000007;
//const int Mod = 998244353;

using mint = MintBase<1000000007>;
void solve()
{
    ll n, a, b;
    cin >> n >> a >> b;
    mint amax = mint((n - a + 1) * (n - a + 1));
    mint bmax = mint((n - b + 1) * (n - b + 1));
    auto total = amax * bmax;
    Print(total.x);
    auto x = (n - a - b + 1);
    Print(x.x);
    auto nonOverlapX = (n - a - b >= 0) ? ((1 + x) * x) : 0;
    Print(nonOverlapX.x);
    mint ab = mint(n - a + 1) * mint(n - b + 1);
    auto overlapX = ab - nonOverlapX;
    auto overlap = overlapX * overlapX;
    Print(overlap.x);
    auto ans = total - overlap;
    cout << ans.x << endl;
}

int main(int, const char**)
{
    ll t;
    cin >> t;
    rep(i, t)
    {
        solve();
    }
    return 0;
}
