#include <iostream>
using namespace std;

int main() {
    int n, m, k, t;
    cin >> t;
    bool test[t];
    int minBananica = 0;
    for (int i = 0; i < t; i++)
    {
        cin >> n >> m >> k;
        for (int j = 1; j <= k; j++)
        {
            minBananica += j;
        }
        if (n > k && minBananica >= m)
        {
            test[i] = true;
        }
        else
        {
            test[i] = false;
        }
    }
    for (int x : test)
    {
        if (test[x])
        {
            cout << "Nie" << endl;
        }
        else
        {
            cout << "Tak" << endl;
        }
    }
    return 0;
}