#include <iostream>

using namespace std;

int main()
{
    int n,m,k,t,i,j;
    cin >> t;
    int a[t];
    for (i=0;i<t;i++)
    {
        cin >> n >> m >> k;
        j=1;
        while (n>=k && j*k<=m)
        {
            n-=k;
            m-=j*k;
            j++;
        }
        if (n*j<=m)
            a[i]=0;
        else
            a[i]=1;
    }
    for (i=0;i<t;i++)
    {
        if (a[i]==0)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;
    }
    return 0;
}