#include <iostream>
#include <math.h>
using namespace std;

int main()
{
    int t,k,m,mmin;
    float n;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>m>>k;
        mmin = round(k*((n/k)*((n/k)+1)/2));
        if(m<mmin)
            cout<<"Nie"<<endl;
        else
            cout<<"Tak"<<endl;
    }
}