#include <iostream>
using namespace std;

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