#include <iostream>

using namespace std;

int main()
{
    ///mora biti deljivo sa pet
    int n;
    cin>>n;
    int ucenik[n],bananica[n],uslov[n],i;
    for(i=0;i<n;i++){
        cin>>ucenik[i]>>bananica[i]>>uslov[i];
    }
for(i=0;i<n;i++){
    if(ucenik[i]==uslov[i]==bananica[i]){
        cout<<"tak"<<endl;
        i++;
    }
if(bananica[i]<ucenik[i]){
       cout<<"nie"<<endl;
       i++;
    }
if(bananica[i]<uslov[i]){
       cout<<"nie"<<endl;
       i++;
}
if(bananica[i]>ucenik[i]*uslov[i]){
    cout<<"tak"<<endl;
  i++;
      }
    if(bananica[i]/ucenik[i]==2&&bananica[i]>ucenik[i]&&bananica[i]>uslov[i]){
                cout<<"tak"<<endl;
                i++;
    }
    else{
        cout<<"nie"<<endl;
    }
}
}