#include <iostream>
#include <vector>
using namespace std;
long mod = 1000000007;

long sqr(long a) {
    return a * a % mod;
}
int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        long n, a, b;
        cin >> n >> a >> b;
        if (n < a + b) {
            cout << 0 << endl;
            continue;
        }
        if (a > b) {
            swap(a, b);
        }
        long s;
        long x = n-a+1;
        long y = n-b+1;
        s = sqr(x)*sqr(y)%mod;
        s += mod - sqr(b-a+1)*sqr(y)%mod;
        s%=mod;
        long z = a - 1;
        long s1 = ((b-a+1)*y%mod)*(y - 1)%mod;
        long sz = ((b-a+1)*y%mod)*(y - z)%mod;
        s += mod - (s1+sz)*z%mod*2%mod;
        s%=mod;
        long s11 = (y-1)*(y-1)%mod;
        long s1z = (y-1)*(y-z)%mod;
        long szz = (y-z)*(y-z)%mod;
        s1 = (s11 + s1z) * z%mod;
        sz = (s1z + szz) * z%mod;
        s += mod - (s1+sz)*z%mod;
        s %= mod;

        cout << s << endl;
    }
}

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file  
#include <ext/pb_ds/tree_policy.hpp>  
#include <functional> // for less  
using namespace         std;
#define                 int long long
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<'\n'
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define sz(A) (int)A.size()
#define N 1014159
#define  vi vector<int>
#define  v  vector
#define die exit(0)
#define alln(arr) arr+1 , arr+1+n
using namespace __gnu_pbds;  
typedef tree<int, null_type, less<int>, rb_tree_tag,  
            tree_order_statistics_node_update> oset; 

// order_of_key (k) : Number of items strictly smaller than k .
// find_by_order(k) : K-th element in a set (counting from zero).

#define in input_int()
#define ins input_string()
bool sb(int a,int i){return (a&(1LL<<i))>0;}
int p2(int a){return (1LL<<a);}
int input_int(){int a;cin>>a;return a;}
string input_string(){string s;cin>>s;return s;}
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int ceil(int a,int b){return (a+b-1)/b;}
int ct,visited[N],ans;
vi adj[N];
int n,m,k,a,b,c,d,x,y,arr[N];
void clr()
{
    forn(i,0,n+10)adj[i].clear(),visited[i]=0,arr[i]=0;
}

inline int mul(int a,int b){return (a*1ll*b)%MOD;}
inline int add(int a,int b){a+=b;if(a>=MOD)a-=MOD;return a;}
inline int power(int a,int b){int rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}
inline int inv(int a){return power(a,MOD-2);}

int get_sum(int a)
{
    if(a<=0)return 0;
    return mul(add(mul(a,a),a),inv(2));
}
string s;
void solve()
{
    cin>>n>>a>>b;
    if(a>b)swap(a,b);

    int ans1=get_sum(n-b-a+1);
    ans1%=MOD;
    int ans2=(n-b+1)*(n-a+1);
    ans2%=MOD;
    //cout<<ans1<<" "<<ans2<<"\n";
    int ans3=get_sum(n-b-a+1);
    ans3=ans3*ans3;
    ans3%=MOD;
    ans3*=2;
    ans3%=MOD;
    int ans=ans1*ans2;
    ans%=MOD;
    ans*=2;
    ans%=MOD;
    ans=ans-ans3+MOD;
    ans%=MOD;
    ans=ans+ans;
    ans%=MOD;
    cout<<ans;
}   


signed main() 
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
    int t = 1;
    cin>>t;
    forn(i,1,t)
    {
        //cout<<":Case #"<<i<<": ";
        solve();
        nl;
    }



    return 0;

}