#include <iostream>
#include <climits>

using namespace std;

int main(){
    
    int t;
    cin >> t;

    if(t>10 || t<1) exit(1);

    int n[t], k[t];
    long m[t];

    for (int i = 0; i < t; i++){
        cin >> n[i] >> m[i] >> k[i];
        if(n[i]<1 || n[i]>INT_MAX || m[i]<1 || m[i]>LONG_MAX || k[i]<1 || k[i]>n[i]) exit(1);
    }

    for (int i = 0; i < t; i++){   
        m[i] = m[i] - k[i] + 1;
        n[i] = n[i] - k[i] + 1;
        
        int s = 0;
        for(int i=1; i<=n[i];i++) s+=i;
        if(s<=m[i]) 
            cout << "Tak" << endl;
        else 
            cout << "Nie" << endl;
    }

    return 0;
}