#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t, n, k;
    cin >> t;
    long long int m;

    for(int i = 0; i < t; i++)
    {
        cin >> n >> m >> k;
        m -= k-1;
        n -= k-1;
        if(m >= (n+1)*n/2)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;
    }


    return 0;
}