#include <iostream>
using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int n, m, k;
        string r = "Tak";
        cin >> n >> m >> k;
        if(k > n || k > m || n > m)
            r = "Nie";
        if(n > k && m == n)
            r = "Nie";
        if(n > k && m == k)
            r = "Nie";
        cout << r;
    }
}