#include <iostream>
#include <iomanip>

using namespace std;

struct ucenik
{
    int n,m,k;
};

void unos(ucenik u[],unsigned t)
{
    for(int i=0;i<t;i++)
        cin>>u[i].n>>u[i].m>>u[i].k;
}

void olovka(ucenik u[],unsigned t)
{
    int j2,j3,br,j;
    for(int i=0;i<t;i++)
    {
            br=0;
            if((u[i].n)==(u[i].m) && u[i].m==(u[i].k))
                cout<<"Tak"<<endl;
            else{
            for(j=u[i].n-u[i].k+1;j>=1;j--)
            {
                j2=(j*(j+1))/2;//1
                j3=(u[i].m)-j2;//2
                if(u[i].n-j<j3)
                    br=br+1;


            }
            if(br>0)
                cout<<"Tak"<<endl;
            else
                cout<<"Nie"<<endl;}
    }
}

int main()
{
    ios::sync_with_stdio(false);
    unsigned t;
    cin>>t;
    ucenik u[t];
    unos(u,t);
    olovka(u,t);

    return 0;
}