#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define s(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)
#define NIL -1
#define MAXN 11

void solve()
{
    ll n, a, b;
    cin >> n >> a >> b;
    if (a + b > n)
        cout << "0\n";
    else
    {
        ll temp = (n - a - b) % mod;
        ll ans = (temp + 1) % mod * (temp + 2) % mod * (2 * (n - a + 1) % mod * (n - b + 1) % mod - (temp + 1) % mod * (temp + 2) % mod + mod) % mod;
        cout << ans << "\n";
    }
}
int main()
{
#ifdef WIN32
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

#ifndef WIN32
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#endif
    int t;
    t = 1;
    cin >> t;
    for (int I = 1; I <= t; I++)
    {
        solve();
    }
    return 0;
}
typedef long long ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;

int main() {
    ll t;
    const ll MOD = 1e9+7;
    std::cin >> t;
    for (int i = 0; i < t; i++) {
        ll n,a,b;
        std::cin >> n>>a>>b;
        if(a>b)swap(a,b);

        ll ma = min(a-1,n-b);
        ll mm = 0;

        mm += 2*ma*(1 - 2*b - ma + 2*n)%MOD*(1 - b + n)%MOD*(b-a+1);
        // std::cout << mm << std::endl;
        mm += ma*ma%MOD*(-2*b-ma+2*n+1)%MOD*(-2*b-ma+2*n+1)%MOD;
        mm += (b-a+1)%MOD*(b-a+1)%MOD*(n-b+1)%MOD*(n-b+1)%MOD;
        mm %= MOD;
        // std::cout << (n-a+1)*(n-a+1)*(n-b+1)*(n-b+1) << std::endl;
        // std::cout << mm << std::endl;

        std::cout << ((n-a+1)%MOD*(n-a+1)%MOD*(n-b+1)%MOD*(n-b+1)%MOD-mm+MOD)%MOD << std::endl;
    }
}