#include<iostream>
using namespace std;
int main()
{
	int t;
	long n,m,k,p,o;
	cin>>t;
	for(int i=0;i<t;i++)
	{
		scanf("%ld", &n);
		scanf("%ld", &m);
		scanf("%ld", &k);
		p = n/k;
		o = n%k;
		if( (k*p*(p+1)+t*(p+1)*(p+2) )/2<=m)
		cout<<"Tak"<<endl;
		else
		cout<<"Nie"<<endl;
	}
}