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