#include <iostream>
using namespace std;

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

    while(t--){
        int i, n, m, k;
        cin >> n >> m >> k;
        if(m - k > ( (k-1)*(k-1) + 4 ) / 2)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;

    }
    return 0;
}