#include <iostream>
using namespace std;
int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; i++)
    {
        int k = 0, j = 1;
        int a, b, c;
        cin >> a >> b >> c;
        while (k<a)
        {
            b -= j;
            k++;
            if (k == c)j++;
        }
        if (b < 0)cout << "Nie" << endl;
        else cout << "Tak" << endl;
    }
    return 0;
}