#include <bits/stdc++.h>
#define LL long long
using namespace std;
const LL P=1e9+7;
const LL X2=2;
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void print(LL x){
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
LL ans,res;
LL n,A,B,C,D;
int main(){
	int T;scanf("%d",&T);
	while(T--){
		scanf("%lld%lld%lld",&n,&A,&B);
		if(A>B) swap(A,B);
		if(A+B>n){
			puts("0");
			continue;
		}
		ans=(n-A+1)*(n-A+1)%P*(n-B+1)%P*(n-B+1)%P;
		res=(B-A+1)*(B-A+1)%P;
		res=res*(n-B+1)%P*(n-B+1)%P;
		ans=ans-res;
		res=(B-A+1)*(n-B+1)%P;
		C=(n+n-B-B-A+X2)*(A-1)%P;
		res=res*C%P;
		ans=ans-res-res;
		res=0;
		C=(n*n%P+n+n+1)%P*(A-1)%P*(A-1)%P;
		res+=C;
		if((A-1)%X2==0){
			D=(A-1)/X2;
			D=D*(B+B+A)%P;
		}
		else {
			D=(B+B+A)/X2;
			D=D*(A-1)%P;
		}
		res+=D*D%P;
		res-=(A-1)*(n+1)%P*D%P;
		res-=(A-1)*(n+1)%P*D%P;
		res=(res%P+P)%P;
		res=res*X2%P*X2%P;
		ans=ans-res;
		ans=(ans%P+P)%P;
		cout<<ans<<endl;
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;

int sum(int a, int b) {
    return a + b >= MOD ? a + b - MOD : a + b;
}
int sub(int a, int b) {
    return a - b < 0 ? a - b + MOD : a - b;
}
int mul(int a, int b) {
    return (1LL*a*b)%MOD;
}
int pw(int a, int b) {
	if (!b) return 1;
	int r = pw(a, b/2);
	r = mul(r, r);
	if (b%2) r = mul(r, a);
	return r;
}

typedef long long LL;

int getSum(int N) {
    LL ans = N;
    ans *= N+1;
    ans /= 2;
    return ans%MOD;
}

int getSum(int L, int R) {
    if (L < 1) L = 1;
    if (L > R) return 0;
    return sub(getSum(R), getSum(L-1));
}

int solve() {
    int N, A, B;
    cin >> N >> A >> B;
    if (A < B) swap(A, B);

    int tmp = getSum(N-A-B+2, N-A);
    int ans = mul(mul(N-A+1, N-A+1), mul(N-B+1, N-B+1));
    ans = sub(ans, mul(4, mul(A-B+1, mul(N-A+1, tmp))));
    ans = sub(ans, mul(4, mul(tmp, tmp)));
    ans = sub(ans, mul(mul(N-A+1, N-A+1), mul(A-B+1, A-B+1)));
    return ans;
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;

    while (t--) {
        cout << solve() << "\n";
    }

    return 0;
}
