#include <iostream>

using namespace std;

int main()
{

    int t;

    cin >> t;

    int n, k;

    long long int m;

    string res[t];

    for(int i = 0; i < t; i++){

        cin >> n >> m >> k;

        n = n - (k - 1);

        m = m - (k - 1);

        if((n * (n + 1)) / 2 <= m) res[i] = "Tak";

        else res[i] = "Nie";

    }

    for(int j = 0;  j < t; j++){

        cout << res[j] << endl;
    }

    return 0;
}