#include<bits/stdc++.h>
using namespace std;
#define MAXN 500007
#define ll long long
//int a[MAXN];
ll count(ll n, ll k)
{
    ll x=n/k;
    return k*(x*(x+1))/2+(n%k)*(x+1); 
}
int solve(ll n, ll m, ll k)
{
    if(count(n,k)>m)
    {
        cout<<"Nie"<<endl;
    }
    else
    {
        cout<<"Tak"<<endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int t;
    ll n,m,k;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        cin>>n>>m>>k;
        solve(n,m,k);
    }
}