#include <bits/stdc++.h>
using namespace std;
long long t,n,k,m,a[2005];
void sastaviniz(){
    a[1]=1;
    for(int i=2;i<=2000;i++){
        a[i] = a[i-1]+i;
    }
}
int main() {
    cin >> t;
    sastaviniz();
    while(t--){
        cin >> n >> m >> k;
        if(n<k) cout << "Nie" <<endl;
        else if(m>=a[n]) cout << "Tak" <<endl;
        else cout << "Nie" <<endl;
    }
return 0;
}