#include <bits/stdc++.h>
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define INF 2000000000000000000
#define ll long long
#define ld long double
#define pll pair<ll, ll>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll mod = pow(10, 9) + 7;
  ll T;
  cin >> T;
  for (ll testcase = 0; testcase < T; ++testcase) {
    ll N, A, B;
    cin >> N >> A >> B;
    if (A + B > N) {
      cout << 0 << "\n";
      continue;
    }
    if (A < B) {
      swap(A, B);
    }
    ll num_a = (N - A + 1) * (N - A + 1) % mod;
    ll num_b = (N - B + 1) * (N - B + 1) % mod;
    ll ans = num_a * num_b % mod;
    ll rev = ((((B - 1) * (B - 1) % mod) * (2 * A + B - 2 * N - 2) % mod) * (2 * A + B - 2 * N - 2)) % mod;
    rev += ((B - 1) * (A - B + 1) % mod) * ((A - N - 1) * (2 * A + B - 2 * (N + 1)) % mod) * 2 % mod;
    rev %= mod;
    rev = (rev + ((N - A + 1) * (N - A + 1) % mod) * ((A - B + 1) * (A - B + 1) % mod) % mod) % mod;
    ans -= rev;
    if (ans < 0) {
      ans += mod;
    }
    cout << ans << "\n";
  }
}

#include <iostream>

using namespace std;
#define ll long long

const ll mod = 1e9 + 7;
const ll MAX = 2e5 + 1;

ll t;

ll power(ll x, ll p) {
  ll ans = 1;
  while (p) {
    if (p & 1) {
      ans = (ans * x) % mod;
      p--;
    }
    x = (x * x) % mod;
    p >>= 1;
  }
  return ans;
}

ll add(ll x, ll y) { return ((x % mod) + (y % mod)) % mod; }
ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod; }
ll sub(ll x, ll y) { return ((x % mod) - (y % mod) + mod) % mod; }
ll nC2(ll x) { return mul(mul(x, x - 1), power(2, mod - 2)); }

void Solve() {
  ll n, a, b;
  cin >> n >> a >> b;
  if (a + b > n) {
    cout << 0 << endl;
    return;
  }
  ll tot = mul(mul(4, nC2(n - a - b + 2)), mul(n - a + 1, n - b + 1));
  ll overlap = mul(4, mul(nC2(n - a - b + 2), nC2(n - a - b + 2)));
  ll ans = sub(tot, overlap);
  cout << ans << endl;
}

signed main() {
  cin >> t;
  while (t--) {
    Solve();
  }
}