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

#define INF ((1<<30)-1)
#define LLINF (1LL<<60)
#define EPS (1e-10)

const ll mod = 1e9 + 7;

ll f1(ll n) {
    if (n < 0) return 0;
    ll res = n * (n + 1) / 2;
    return res % mod;
}

ll f2(ll n) {
    if (n < 0) return 0;
    ll res = f1(n);
    res %= mod;
    res *= res;
    res %= mod;
    return res;
}

void solve() {
    int n, a, b;
    cin >> n >> a >> b;
    ll x = ((f1(n - a - b + 1) * (n - b + 1) % mod) * (n - a + 1)) % mod;
    ll y = f2(n - a - b + 1) % mod;
    ll ans = (x*4) % mod - (y*4) % mod;
    cout << (ans + mod) % mod << endl;
}

int main() {
    int T;
    cin >> T;
    rep(t, T) {
        solve();
    }
}

#include <iostream>
#include <algorithm>

using namespace std;

const long long waru = 1000000007;

int main()
{
	long long t;
	cin >> t;

	long long ans[100000];

	for (long long q = 0; q < t; q++) {
		long long n, a, b;
		cin >> n >> a >> b;

		if (a < b) swap(a, b);

		long long answer = 0;
		long long m_answer = 0;

		if (n < a + b) {
			ans[q] = 0;
			continue;
		}

		answer = ((n - a + 1) * (n - b + 1) * 4) % waru;
		long long pk = ((n - a - b + 1) * (n - a - b + 2) / 2) % waru;
		answer = (answer * pk) % waru;

		long long f = ((n - a - b + 1) * (n - a - b + 2) / 2) % waru;
		m_answer = (f * f * 4) % waru;

		answer = (answer - m_answer + waru) % waru;

		ans[q] = answer;
	}

	for (long long i = 0; i < t; i++) {
		cout << ans[i] << endl;
	}

}