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


  }

 return 0;
}