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