#include<bits/stdc++.h>
using namespace std;

#define ll long long

void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;

	// neki bazni slucajevi
	if (m < n) {
		cout << "Nie\n";
		return;
	}

	if (n == k) {
		cout << "Tak\n";
		return;
	}
	
	ll n2 = n - (k - 1);
	ll m2 = m - (k - 1);

	if (2*m2 > (n2 - 1) * (n2 + 2)) {
		cout << "Tak\n";
		return;
	}

	// sada pokusavamo da nadjemo neko optimalno
	// n2
	ll c = 0, d = 0;

	while(n2 > 0) {
		c = (d + 1) * (d + 2) / 2;
		c -= 1;

		n2 -= d;
		m2 -= c;

		if (2 * m2 > (n2 - 1) * (n2 + 2)) {
			cout << "Tak\n";
		}
		++d;
	}
	cout << "Nie\n";
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin >> t;
	while(t--) {
		solve();
	}

	return 0;
}