#include <bits/stdc++.h>
using namespace std;
const int mod=1000000007;
using ll = long long;
ll sqr(ll x)
{
x%=mod;
return x*x%mod;
}
int main()
{
int T;
scanf("%d",&T);
while (T--) {
ll n,a,b;
scanf("%lld%lld%lld",&n,&a,&b);
if (a+b>n) {
puts("0");
continue;
}
if (a<b) swap(a,b);
ll ans = 0;
ll sum = ((n-(a+b-1)+1)+(n-(a+1)+1))%mod*(b-1)%mod;
if (sum&1) {
sum=(sum+mod)/2;
} else {
sum/=2;
}
ans = sum*sum%mod*4%mod;
ans += (n-a+1)*sum%mod*(a-b+1)%mod*4%mod;
ans += sqr(n-a+1)*sqr(a-b+1)%mod;
ans %= mod;
ans = sqr(n-a+1)*sqr(n-b+1)%mod - ans;
if (ans<0) ans+=mod;
printf("%lld\n",ans);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbW9kPTEwMDAwMDAwMDc7CnVzaW5nIGxsID0gbG9uZyBsb25nOwoKbGwgc3FyKGxsIHgpCnsKICAgIHglPW1vZDsKICAgIHJldHVybiB4KnglbW9kOwp9CgppbnQgbWFpbigpCnsKICAgIGludCBUOwogICAgc2NhbmYoIiVkIiwmVCk7CiAgICB3aGlsZSAoVC0tKSB7CiAgICAgICAgbGwgbixhLGI7CiAgICAgICAgc2NhbmYoIiVsbGQlbGxkJWxsZCIsJm4sJmEsJmIpOwogICAgICAgIGlmIChhK2I+bikgewogICAgICAgICAgICBwdXRzKCIwIik7CiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgIH0KICAgICAgICBpZiAoYTxiKSBzd2FwKGEsYik7CiAgICAgICAgbGwgYW5zID0gMDsKICAgICAgICBsbCBzdW0gPSAoKG4tKGErYi0xKSsxKSsobi0oYSsxKSsxKSklbW9kKihiLTEpJW1vZDsKICAgICAgICBpZiAoc3VtJjEpIHsKICAgICAgICAgICAgc3VtPShzdW0rbW9kKS8yOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHN1bS89MjsKICAgICAgICB9CgogICAgICAgIGFucyA9IHN1bSpzdW0lbW9kKjQlbW9kOwogICAgICAgIGFucyArPSAobi1hKzEpKnN1bSVtb2QqKGEtYisxKSVtb2QqNCVtb2Q7CiAgICAgICAgYW5zICs9IHNxcihuLWErMSkqc3FyKGEtYisxKSVtb2Q7CiAgICAgICAgYW5zICU9IG1vZDsKCiAgICAgICAgYW5zID0gc3FyKG4tYSsxKSpzcXIobi1iKzEpJW1vZCAtIGFuczsKICAgICAgICBpZiAoYW5zPDApIGFucys9bW9kOwogICAgICAgIHByaW50ZigiJWxsZFxuIixhbnMpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=