#include <bits/stdc++.h>
using namespace std;
int main(){
    long long t,n,m,k,g;
    cin >> t;
    for(int i=0;i<t;i++){
        cin >> n >> m >> k;
        g=1.0*n/k;
            if(((1.0*n/k*(1.0*n/k+1))/2)*k<=m)
                cout << "Tak" << endl;
            else
                cout << "Nie" << endl;
        }

    }