#include <bits/stdc++.h>

#define MOD 1000000007
#define MAXN 1000000
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vd vector<double>
#define vll vector<long long>
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define pi pair<int, int>
#define pll pair<long long, long long>
#define mp make_pair
#define fi first
#define se second
#define rep(i,s,n) for(ll i = s;i <= n;i++)
#define repi(n) for (int i = 0; i < n; i++)
#define repj(n) for (int j = 0; j < n; j++)
#define deb_vec(a) for(auto i : a) cout << i << " "; cout << "\n"
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL)
#define t_cases ll t; cin >> t; while(t--)
#define debug(a) cout << a << "\n"

using namespace std;


void solve() {

    int a, b, c; cin >> a >> b >> c;
    if (a >= 0 and b >= 0) {

        if (a > b) cout << ">";
        else if (a < b) cout << "<";
        else cout << "=";

    } else if (a < 0 and b >= 0) {

        if (c & 1) cout << "<";
        else if (abs(a) > abs(b)) cout << ">";
        else if (abs(a) < abs(b)) cout << "<";
        else cout << "=";

    } else if (a >= 0 and b < 0) {

        if (c & 1) cout << ">";
        else if (abs(a) > abs(b)) cout << ">";
        else if (abs(a) < abs(b)) cout << "<";
        else cout << "=";

    } else {

        if (c & 1) {
            if (abs(a) > abs(b)) cout << "<";
            else if (abs(a) < abs(b)) cout << ">";
            else cout << "=";
        } else {
            if (abs(a) > abs(b)) cout << ">";
            else if (abs(a) < abs(b)) cout << "<";
            else cout << "=";
        }

    }

}

int main() {

    FAST;

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    solve();

}

/*
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <assert.h>
#include <math.h>
#include <memory.h>
#include <stdio.h>

#include <algorithm>
#include <complex>
#include <ctime>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define left asdgashgrketwjklrej
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd
#define prev asdgSHJsfgsdfhdsh
#define hash asdgasdgasdgdfrywewery

#define eps 1e-12
#define M_PI 3.141592653589793
#define bsize 1024

#define ldouble long double
using namespace std;

const int bs = 1000000007;

const int N = 200031;

int tests;

long long count_splits(long long len){
	// we have to split len over 3 blocks, zeroes allowed.
	// this is C(len+2,2)
	long long A=len+2;
	long long B=len+1;
	if (A%2)
		B/=2;
	else
		A/=2;
	return A*B%bs;
}

long long solver(long long n,long long a,long long b){
	long long free_spots=n-a-b;
	if (free_spots<0)
		return 0;
	return count_splits(free_spots);
}

int main() {
    //freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    // cin.tie(0);

    cin>>tests;
    for (;tests;--tests){
    	long long n,a,b;
    	cin>>n>>a>>b;
    	long long ans=solver(n,a,b);
    	ans=ans*2%bs;
    	long long all_placements=1ll*(n-a+1)*(n-b+1)%bs;
    	long long bad=all_placements-ans;
    	if (bad<0)
    		bad+=bs;
    	long long really_bad=1ll*bad*bad%bs;
    	long long good=all_placements*all_placements%bs-really_bad;
    	if (good<0)
    		good+=bs;
//    	cout<<bad<<" "<<really_bad<<" "<<all_placements<<endl;
    	cout<<good<<endl;
    }

    //cin.get(); cin.get();
    return 0;
}
