#include <bits/stdc++.h>
using namespace std;
long long t,n,m,k,ps[1000005],j;
int main(){
    cin>>t;
    ps[0]=0;
    j=1;
    for(int i=1;i<=1000005;i++){
            ps[i]=j+ps[i-1];
            j++;
    }
    while(t--){
        cin>>n>>m>>k;
        if(n==k and m>n){
            cout<<"Tak"<<endl;
        }
        else if(n>k and (ps[n-k+1]+k-1<=m)){
            cout<<"Tak"<<endl;
        }
        else{
            cout<<"Nie"<<endl;
        }

    }

    return 0;
}