#include <bits/stdc++.h>
using namespace std;
int main(){
int T,N,M,K;
cin>>T;
while(T--){
    cin>>N>>M>>K;
if(K<=N and ((1*(N*(N+1)))/2)<=M)
    cout<<"Tak"<<endl;
else
    cout<<"Nie"<<endl;
}
return 0;
}