#include<iostream>
#define ll long long
using namespace std;
ll n,k,l,m,ans,ansi;
int main()
{
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> k >> l >> m;
		ansi = max(k%m,k/m);
		if(((ansi+1)*ansi)/2<=l)cout << "Tak\n";
		else cout << "Nie\n";
	}
	
}