#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define maxn 200050

using namespace std;
typedef long long ll;

ll t, n, m, k, q, r;

void solve()
{
	cin >> n >> m >> k;
	q=n/k;
	r=n%k;
	if((q+1)*(k*q+2*r)/2<=m) cout << "Tak\n";
	else cout << "Nie\n";
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> t;
	while(t--){
        solve();
	}
}