#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
	long long n, g[200000];
	int a,b,c,q,r;
	float p;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		q=a/c;
		p=q;
		r=(q+1)*(p/2)*c;
		if(a%2==0 && r<=b || a%2!=0 && r<=b+q+1) g[i]=1;
		else g[i]=0;	
	}
		for(int i=0;i<n;i++) {
			if(g[i]==1) cout<<"Tak \n";
			else cout<<"Nie \n";
		}
	return 0;
}