#include <iostream>

using namespace std;

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

}