#include <iostream>

using namespace std;

int asd(int n, int m, int k)
{
    unsigned int a = n/k, b=n%k;
    unsigned int c = ((k-b)*((a*(a+1))/2))+((b)*(((a+1)*(a+2))/2));

    if(c<m)
        return 1;

    return 0;
}


int main()
{

    int z;
    cin>>z;
    int a[z];
    unsigned int n,m,k;
    for(int i=0;i<z;i++)
    {
     cin>>n>>m>>k;
     a[i]=asd(n,m,k);

    }

    for(int i=0;i<z;i++)
    {
        if(a[i]==1)
            cout<<"Tak"<<endl;
        else
            cout<<"Nie"<<endl;
    }

    return 0;
}