#include <bits/stdc++.h>

using namespace std;

int main()
{   long long t; cin >> t;
    long long n, m , k;
    bool moguce = true;
    for(long long i = 0; i<t; i++){
        cin >> n >> m >> k;
        if(n<k || m<n || m<k){
            moguce = false;}
    if(moguce){
        if( m-(k-1) >=  ((n-(k-1))* ((n-(k-1))+1))/2  ){
            cout << "Tak"<<endl;
        }
        else cout << "Nie"<<endl;

    }
    else cout << "Nie"<<endl;}

    return 0;
}