#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
long long t,n,m,k,ccnt,pos=0,sum=0,minn2=INT_MAX,sum2,cnt=0,cnt1=0,cnt2=0,cnt3=0,cnt4=0,cnt5=0,cnt6=0,cnt7=0,a[2000005],x1,y7,x2,y2,x3,y3,aaa,bbb;
long long vis1[1005][1005],vis2[1005][1005],b[1000005],c[1000005],c3[2005][2005],c4[1000005],kk[1000005],x,y,z,d=0,l2,r2;
long long pos1=0,pos2=0,tem,tem2,l,r,ans=0,ans2,mod=998244353,tw[100005],th[100005],dd,ee,out[1000005],te[100005];
long long minn=LONG_LONG_MAX,maxx=-LONG_LONG_MAX,maxx2;
string s1,s2,s;
char cc[2005][2005],ch;
pair<int,int> p[200005];
vector<int> v[200005];
long long fpow(long long aa,long long bb)
{
    if(bb==0)
    {
        return 1;
    }
    else if(bb<0)
    {
        return 0;
    }
    long long kk1=aa;
    long long kk2=1;
    while(bb>1)
    {
        if(bb%2)
        {
            kk2*=kk1;
            kk2%=mod;
        }
        kk1*=kk1;
        kk1%=mod;
        bb=bb/2;
    }
    return (kk1*kk2)%mod;
}
long long co(long long x,long long y)
{
    long long ans=1;
    long long ans2=1;
    if(x==y||y==0)
    {
        return 1;
    }
    else
    {
        for(int i=x-y+1;i<=x;i++)
        {
            ans=ans*i;
            ans=ans%mod;
        }
        for(int i=1;i<=y;i++)
        {
            ans2=ans2*i;
            ans2=ans2%mod;
        }
        ans2=fpow(ans2,mod-2);
        ans2=(ans2*ans)%mod;
        return ans2;
    }
}
signed main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>s;
    d=1;
    for(int i=0;i<s.size();i++)
    {
        if(i%2==0)
        {
            if(s[i]-'a'<0)
            {
                d=0;
                break;
            }
        }
        else
        {
            if(s[i]-'A'>=26)
            {
                d=0;
                break;
            }
        }
    }
    if(d)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }





}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (ll i=(ll)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const ll INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(ll x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { ll d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll modpow(ll x, ll p) { ll result = 1, now = 1, pm = x; while (now<=p) { if (p&now) { result = result * pm % MOD; } now*=2; pm = pm*pm % MOD; } return result; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll T; cin >> T;
  rep(_,T) {
    ll N, A, B; cin >> N >> A >> B;
    if (A+B>N) { cout << 0 << endl; continue; }
    ll t1 = (N-A-B+1) * (N-A-B+2) / 2 % MOD;
    ll x1 = t1 * t1 % MOD, x2 = t1 * ((N-A+1)*(N-B+1)%MOD) % MOD;
    ll result = (x2-x1+MOD) * 4 % MOD;
    cout << result << endl;
  }
  return 0;
}