#include <iostream>
//#include <fstream>
//#include <iomanip>
//#include <cmath>
//#include <algorithm>
//#include <string>
//#include <vector>
//#include <utility>
//#include <map>
//#include <ctime>
//#include <cctype>
//#include <cstdlib>
//#include <limits>
//#include <numeric>
//#include <mycpp.h>

using namespace std;

bool Slucaj()
{
	long long n, m, k, a, b;
	cin >> n >> m >> k;
	a = n - k + 1;
	b = (a % 2 == 0) ? ((a / 2) * (a + 1)) : (((a + 1) / 2) * a);
	return ((m - b) >= (k - 1));
}

int main()
{
	std::ios_base::sync_with_stdio(false);
	int t;
	cin >> t;
	bool odg[t];
	for(int i = 0; i < t; i++)
		odg[i] = Slucaj();
	for(int i = 0; i < t; i++)
		cout << (odg[i] ? "Tak" : "Nie") << endl;
	
}