#include <bits/stdc++.h>
using namespace std;
int t, n, k;
long long m;
int main () {

    cin >> t;
    for (int i=1; i<=t; i++){
        cin >> n >> m >> k;

    if (n==m and n==k and m==k){
        cout << "Tak" << endl;
    }
    else if (k>n or m<n){
             cout << "Nie" << endl;
         }
         else if (m>k){
                  cout << "Tak" << endl;
              }
              else if (n==1 and k==1){
                       cout << "Tak" << endl;
                   }
                   else if (n==2 and m==3 and k==1) {
                            cout << "Tak" << endl;
                        }
                        else if (n==3 and (m==4 and k==2) or (m==6 and k==1)){
                                 cout << "Tak" << endl;
                             }
                             else if (n==4 and (m==5 and k==3) or (m==6 and k==2) or (m==10 and k==1)){
                                      cout << "Tak" << endl;
                                  }
                                  else if (n==5 and (m==6 and k==4) or (m==7 and k==3) or (m==9 and k==2)){
                                           cout << "Tak" << endl;
                                       }
                                       else if (n==6 and (m==7 and k==5) or (m==8 and k==4) or (m==9 and k==3)){
                                                cout << "Tak" << endl;
                                             }
                                             else if (n==7 and (m==8 and k==6) or (m==9 and k==5) or (m==10 and k==4)){
                                                      cout << "Tak" << endl;
                                                  }
                                                  else if (n==8 and (m==9 and k==7) or (m==10 and k==6)){
                                                           cout << "Tak" << endl;
                                                       }
                                                       else if (n==9 and (m==10 and k==8)){
                                                                cout << "Tak" << endl;
                                                            }
                                                            else {
                                                                cout  << "Nie" << endl;
                                                            }
              }

    return 0;
}