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

const int MOD = 1000000007;

int main() {
    int T;
    cin >> T;

    rep(i, T) {
        ll N, A, B;
        cin >> N >> A >> B;

        ll d = max(0LL, N - A - B + 1) % MOD;
        ll ans = 2 * d % MOD * (d + 1) % MOD * (N - A + 1) % MOD * (N - B + 1) %
                     MOD -
                 d * d % MOD * (d + 1) % MOD * (d + 1) % MOD;
        if (ans < 0) ans += MOD;
        cout << ans << endl;
    }
}
// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int ll
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define ll long long
#define pi pair<int,int> 
#define pii pair<pi,int>
#define vi vector<int>
#define pb push_back 
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll fastexp(ll x,ll a){
    ll res = 1;
    while(a>0){
        if(a&1){
            res = (res*x)%mod;
        }
        a=a>>1;
        x=(x*x)%mod;
    }
    return res;
}
ll inverse(ll n){
    return fastexp(n,mod-2);
}
template <typename T>
void add(T &a, T b){
	a += b;
	if(a >= mod)a -= mod;
}
template <typename T>
void sub(T &a, T b){
	a -= b;
	if(a < 0)a += mod;
}
template <typename T>
void mul(T &a, T b){
	a *= b;
	if(a >= mod)a %= mod;
}
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a,b;
	cin>>a>>b;
	int sign = 1;
	if(b > a){
		sign = -1;
	}
	vi v(a+b);
	int sum = 0;
	rep(i,max(a,b)){
		v[i] = sign*(i+1);
		sum += (i+1);
	}
	sign *= (-1);
	int j = 1;
	repa(i,max(a,b),a+b-1){
		v[i] = sign*(j);
		sum -= j;
		j++;
	}
	v[a+b-1] = sign*sum;
	rep(i,a+b){
		cout<<v[i]<<" ";
	}
	return 0;
}