#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Mod 1000000007
ll cmod(ll a){return (a%Mod+Mod)%Mod;}
inline ll read(){ll x;scanf("%lld",&x);return x;}
ll solve()
{
	ll N=read(),A=read(),B=read();
	if(N-A-B<0) return 0;
	if(A<B) swap(A,B);
	ll x1=(B-1)*(B-1)%Mod*(2*N+2-2*A-B)%Mod*(2*N+2-2*A-B)%Mod;
	ll x2=(A-B+1)*(N-A+1)%Mod*(B-1)%Mod*(4*N+4-4*A-2*B)%Mod;
	ll x3=(N-A+1)*(N-A+1)%Mod*(A-B+1)%Mod*(A-B+1)%Mod;
	ll x=(N-A+1)*(N-A+1)%Mod*(N-B+1)%Mod*(N-B+1)%Mod;
	return cmod(x-x1-x2-x3);
}
int main()
{
	ll t=read();
	while(t--) cout<<solve()<<endl;
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int T;
  cin >> T;
  
  int64_t N, A, B;
  
  const int64_t mod = 1000000007;
  
  for (int Case = 0; Case < T; Case++) {
    cin >> N >> A >> B;
    
    if (A+B>N) {
      cout << 0 << endl;
      continue;
    }
    
    int64_t Count = (N+1-A)*(N+1-A) % mod;
    Count = Count * (N+1-B) % mod;
    Count = Count * (N+1-B) % mod;
    
    int64_t Del;
    Del = (N+1-A)*(A+B-1) % mod;
    Del = (Del - (B-1)*B%mod + mod) % mod;

    Del = Del*Del % mod;
    Count = (Count - Del + mod) % mod;
     
    cout << Count << endl;
  }

return 0;
}