#include <iostream>

using namespace std;

struct pod
{
    int n, m, k;
};

int sum (int x, int y)
{
    int n1 = x / y;
    int n2 = x % y;
    return (y-n2)*(n1-1)*n1/2 + n2*n1*(n1+1)/2;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    pod a[t];
    for(int i = 0; i < t; ++i)
        cin >> a[i].n >> a[i].m >> a[i].k;
    for(int i = 0; i < t; ++i)
    {
        if((a[i].m - sum(a[i].n, a[i].k)) / a[i].n >= 1)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;
    }
	return 0;
}