#include <iostream>

using namespace std;

int main()
{
int t, n, m, k;
cin>>t;
for(int i=1; i<=t; i++)
{
    cin>>n>>m>>k;
    if((n*(n+1))/2<=m)
        cout<<"Tak"<<endl;
    else cout<<"Nie"<<endl;
}
}