#include <bits/stdc++.h>
using namespace std;
long long T,ucenici,bananice,grupe,niz[1005];
int main(){
    cin>>T;
    while(T--){
        cin>>ucenici>>bananice>>grupe;
        if(bananice>ucenici){
            if((bananice/grupe)%2==0 or (bananice%ucenici)%2==0){
                cout<<"Tak"<<endl;
            }
            else{
                cout<<"Nie"<<endl;
            }
        }
        else{
            cout<<"Nie"<<endl;
        }
    }
    return 0;
}