#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) ((x).begin()), ((x).end())

#define READ(x) (cin >> (x))
#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))
#define WRITE_YESNO(x) (WRITE_N((x) ? "Yes" : "No"))

#define PRECISE_COUT std::cout << std::setprecision(15) << std::fixed

bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }

#define DIVIDER 1000000007LL

ll solve(ll N, ll A, ll B) {
  if (A + B > N) {
    return 0;
  }

  ll retv = (((N - A + 1) * (N - A + 1)) % DIVIDER) *
            (((N - B + 1) * (N - B + 1)) % DIVIDER);
  retv %= DIVIDER;

  ll x = (N - A + 1) * (N - B + 1) - (N - A - B + 1) * (N - A - B + 2);
  x = x % DIVIDER;
  retv = (retv - ((x * x) % DIVIDER) + DIVIDER) % DIVIDER;
  return retv;
}

int main() {
  // get values from input
  cin.tie(0);
  ios::sync_with_stdio(false);

  int T;
  cin >> T;

  // main procedure
  vector<ll> ans;
  for (size_t i = 0; i < T; i++) {
    ll N, A, B;
    cin >> N >> A >> B;
    ans.push_back(solve(N, A, B));
  }

  // output
  for (size_t i = 0; i < T; i++) {
    cout << ans[i] << endl;
  }

  return 0;
}
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set     tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
// find_by_order(k):    It returns to an iterator to the kth element (counting from zero) in the set
// order_of_key(k) :    It returns to the number of items that are strictly smaller than our item k
#define fast            ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb              push_back
#define f               first
#define s               second
#define F(i,a,b)        for(i=a;i<b;i++)
#define nl              "\n"
#define sp              " " 
#define all(c)          (c).begin(),(c).end()
#define rev(i,b,a)      for(int i=b;i>=a;i--)
#define iota            cout<<-1<<nl
#define cty             cout<<"YES"<<nl
#define ctn             cout<<"NO"<<nl
#define lmax            LLONG_MAX
#define lmin            LLONG_MIN
#define sz(v)           (v).size()
#define deci(n)         fixed<<setprecision(n)
#define c(x)            cout<<(x)
#define csp(x)          cout<<(x)<<" "
#define c1(x)           cout<<(x)<<nl
#define c2(x,y)         cout<<(x)<<" "<<(y)<<nl
#define c3(x,y,z)       cout<<(x)<<" "<<(y)<<" "<<(z)<<nl
#define c4(a,b,c,d)     cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<nl
#define c5(a,b,c,d,e)   cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<nl
#define c6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<nl
typedef long double     ld;
typedef long long       ll;
typedef vector<ll>      vll;
typedef pair<ll,ll>     pll;
typedef vector<pll>     vpll;
const int mod=998244353;
const int mod1=1000000007;
const double pi=3.14159265358979323846264338327950288419716939937510582097494459230;
// priority_queue<t>
ll max(ll a , ll b){ if(a>b)return a; return b;}
ll min(ll a , ll b){ if(a<b)return a; return b;}
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // divide a by b rounded up
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // divide a by b rounded down
ll pct(ll x) { return __builtin_popcount(x); } // # of bits set
ll poww(ll a, ll b) { ll res=1; while(b) { if(b&1)	res=(res*a); a=(a*a); b>>=1; } return res; }
ll modI(ll a, ll m=mod) { ll m0=m,y=0,x=1;  if(m==1) return 0;  while(a>1)  { ll q=a/m; ll t=m;  m=a%m;  a=t; t=y; y=x-q*y;  x=t; } if(x<0) x+=m0; return x;}
ll powm(ll a, ll b,ll m=mod) {ll res=1;	while(b) {	if(b&1)	res=(res*a)%m;	a=(a*a)%m; b>>=1;	}	return res;}
//*******************************************************************************************************************************************//
void iamzeus()
{ ll i,j,x=0,y,ans=0,n,m,d,cnt=0,z,c=2,k;
  cin>>n;
 vpll v(n);
 for(i=0;i<n;i++)cin>>v[i].f>>v[i].s;
 vector<pair<pll,ll>>v1,v2;
 for(i=0;i<n;i++)
 {
     v1.pb({{v[i].f,v[i].s},i});
     v2.pb({{v[i].s,v[i].f},i});
     
 }
 sort(all(v1));
 sort(all(v2));
 vector<pair<ll,pll>>v4;
 v4.pb({v1[n-1].f.f-v1[0].f.f,{min(v1[n-1].s,v1[0].s),max(v1[n-1].s,v1[0].s)}});
  v4.pb({v1[n-1].f.f-v1[1].f.f,{min(v1[n-1].s,v1[1].s),max(v1[n-1].s,v1[1].s)}});
 v4.pb({v1[n-2].f.f-v1[0].f.f,{min(v1[n-2].s,v1[0].s),max(v1[n-2].s,v1[0].s)}});
 v4.pb({v2[n-1].f.f-v2[0].f.f,{min(v2[n-1].s,v2[0].s),max(v2[n-1].s,v2[0].s)}});
  v4.pb({v2[n-1].f.f-v2[1].f.f,{min(v2[n-1].s,v2[1].s),max(v2[n-1].s,v2[1].s)}});
 v4.pb({v2[n-2].f.f-v2[0].f.f,{min(v2[n-2].s,v2[0].s),max(v2[n-2].s,v2[0].s)}});
sort(all(v4),greater<pair<ll,pll>>());
 map<pll,ll>mp;
 cnt=0;
 for(auto u:v4)
 {
     if(mp.find({u.s.f,u.s.s})==mp.end())
     {
         cnt++;
         if(cnt==2)
         {
             c1(u.f);
             return;
         }
     }
     mp[{u.s.f,u.s.s}]=1;
 }
 
};
int main()
{fast;
    int t;
 t=1;
//cin >>t;
 while(t--)
     iamzeus();
}
