#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    long long n,m,k;
    cin >> t;
    bool res[t];

    for(int i = 0; i < t; ++i) {
        cin >> n >> m >> k;

        long long temp,tempR,r;
        temp = n/k;
        tempR = n%k;

        r = temp*(temp+1)/2 + tempR*(temp+1);
        if(r > m) res[i] = false;
        else res[i] = true;
    }

    for(bool i: res) {
        if(i) cout << "Tak" << endl;
        else cout << "Nie" << endl;
    }

    return 0;
}