#include <iostream>

using namespace std;

 long long formula(int N, int K)
 {
     return (N/K)*(N/K+1)/2*K+(N%K)*(N/K+1);
 }
int main()
{
    int N;
    long long S;
    int K;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>N;
        cin>>S;
        cin>>K;
        if(formula(N,K)>S)
        {
            cout<<"Nie";

        }
        else
        {
         cout<<"Tak";
        }
    }
    return 0;
}