#include <iostream>
#include <string>
using namespace std;
int main(){
	int t,p,r;
	cin>>t;
	int n[t];
	int m[t];
	int k[t];
    string odg[t];
	for(int i=0;i<t;i++){
		cin>>n[i]>>m[i]>>k[i];
		p=n[i]/k[i];
		r=(p+1)*(n[i]%k[i])+p*(p+1)*k[i]/2;
		if(r<=m[i])odg[i]="Tak";
		else odg[i]="Nie";
	}
    for(int i=0;i<t;i++){
        cout<<odg[i]<<endl;
    }
	return 0;
}