#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = int64_t; using ull = uint64_t; const ll INF = 9e18;
void print() { cout << endl; }
template<typename Head,typename... Tail> void print(Head head,Tail... tail){cout<<head;if(sizeof...(Tail)>0)cout<<" ";print(tail...);}
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<head;print0(tail...);}
// clang-format on

const ll MODULO = 1000000007LL;
ll mod_pow(ll x, ll n, ll modval) {
    if (n == 0) {
        return 1;
    }
    ll res = mod_pow(x * x % modval, n / 2, modval);
    if (n & 1) {
        res = res * x % modval;
    }
    return res;
}
ll mod_minus(ll x, ll modval) {
    if (x >= 0) {
        return x % modval;
    } else {
        ll mm = ((-x) % modval);
        if (mm == 0) {
            return 0;
        } else {
            return modval - mm;
        }
    }
}
ll mod(ll x) {
    return mod_minus(x, MODULO);
}
ll mod_inv(ll k, ll modval) {
    return mod_pow(k, modval - 2, modval);
}
ll minv(ll k) {
    return mod_pow(k, MODULO - 2, MODULO);
}

ll mmult(ll x, ll y) {
    return mod(x * y);
}
ll sum2(ll x) {
    return mmult(mmult(mmult(x, x + 1), 2 * x + 1), minv(6));
}
ll summ2(ll x) {
    return x * (x + 1) * (2 * x + 1) / 6;
}
ll sum1(ll x) {
    return mod(x * (x + 1) / 2);
}
void solve() {
    ll N, A, B;
    cin >> N >> A >> B;

    ll x4;
    if (N - A - B < 0) {
        x4 = 0;
    } else {
        x4 = mmult(mmult(N - A - B + 2, N - A - B + 1), minv(2));
    }
    ll x3 = mmult(x4, 2);
    ll x2 = mod(mmult(N - A + 1, N - B + 1) - x3);
    ll x1 = mmult(x2, x2);
    ll result = mod(mmult(mmult(mmult(N - A + 1, N - A + 1), N - B + 1), N - B + 1) - x1);
    print(result);

    // if (A < B) {
    //     swap(A, B);
    // }
    // ll result = mmult(mmult(N - A + 1, N - A + 1), mmult(N - B + 1, N - B + 1));

    // // 重複を減らす
    // ll invalid = 0;
    // invalid = mod(invalid + mmult(A - B + 1, A - B + 1));
    // invalid = mod(invalid + mmult(mmult(A - B + 1, B - 1), 4));
    // invalid = mod(invalid + mmult(mmult(mmult(A - B + 1, B - 1), B - 1), 4));
    // result = mod(result - mmult(invalid, mmult(N - A + 1, N - A + 1)));

    // // 重複のうち起こりえないものを戻す
    // result = mod(result + mmult(mmult(sum1(B - 1), N - A + 1), 4));
    // result = mod(result + mmult(mmult(mmult(sum1(B - 1), min(N - A + 1, B - 1)), N - A + 1), 8));
    // // 戻した中に重複がある
    // result = mod(result - mmult(sum1(B - 1), 4));
    // print(result);
}
int main() {
    ll T;
    cin >> T;

    for (ll i = 0; i < T; i++) {
        solve();
    }
}

#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


const long long MOD = 1000000007;
int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);


    int t;
    cin >> t;

    auto count = [&](long long N, long long l, long long r, long long t, long long b) {
        auto n = r - l + 1;
        auto m = b - t + 1;
        if (n <= 0 || m <= 0) {
            return 0LL;
        }
        long long x = ((N + 1 - l) + (N + 1 - r)) * n / 2 % MOD;
        long long y = ((N + 1 - t) + (N + 1 - b)) * m / 2 % MOD;
        long long res = x * y % MOD;
        res *= 4;
        res %= MOD;
        return res;
    };

    auto count2 = [&](long long N, long long A, long long B) {
        long long res = 0;

        long long cnt = (N - A - B + 1);
        long long x = (1 + cnt) * cnt / 2 % MOD;
        x = x * (B - A + 1) % MOD;
        res = x * (N - B + 1) % MOD;
        res *= 4;
        res %= MOD;
        return res;
    };

    while (t-- > 0) {
        long long N, A, B;
        cin >> N >> A >> B;
        if (N < A + B) {
            cout << 0 << '\n';
        } else {
            if (A > B) {
                swap(A, B);
            }
            long long res = 0;
            res += count(N, B + 1, A + B - 1, A + B, N);
            res += count(N, A + B, N, B + 1, A + B - 1);
            res += count(N, A + B, N, A + B, N);
            res += count2(N, A, B);
            res %= MOD;
            cout << res << '\n';
        }
    }


    return 0;
}