#include <bits/stdc++.h>
#define en '\n'
#define fi first
#define se second
#define pii pair<int,int>
#define ll long long
using namespace std;

ll n,m,k,mn;

void solve()
{
    cin >> n;
    cin >> m;
    cin >> k;
    ll cd = n/k;
    mn = (ll)k*cd*(cd+1)/2;
    mn += (ll) (n-cd*k)*(cd+1);
    if(m < mn) cout << "Nie";
    else cout << "Tak";
    cout << en;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int tc; cin >> tc;
    while(tc--) solve();
}