#include <iostream>
using namespace std;
int main()
{
    int t;
    int n,m,k;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        cin>>n>>m>>k;
        if(m<=n) cout<<"Nie"<<endl;
        else
        {
            if(k*m<(n/k)*(n/k+1)/2)
            {
                cout<<"Nie"<<endl;
            }
            else cout<<"Tak"<<endl;
        }
    }
    return 0;
}