#include <bits/stdc++.h>
using namespace std;

int main()
{
    int test;
    cin >> test;
    for (int i = 0; i < test; i++)
    {
        long long g, c, b;
        cin >> c >> b >> g;
        bool provera = true;

        if (g > b || g > c)
        {
            provera = false;
        }

        long long g1 = b / g;
        long long g2 = b % g;
        if (g2 != 0)
            g2 = g2 + g1;

        long long c1, c2;
        c1 = c / g;
        c2 = c % g;
        if (c2 != 0)
            c2 = c1 + c2;

        long long sum1 = ((c1 + 1) * c1) / 2;
        long long sum2 = 0;
        if (c2 != 0)
            sum2 = ((c2 + 1) * c2) / 2;

        if (g2 == 0)
        {
            if (sum2 > g1)
                provera = false;
            if (sum1 > g1)
                provera = false;
        }
        else
        {
            if (sum1 > g1)
                provera = false;
            if (sum2 > g2)
                provera = false;
        }

        if (provera == true)
            cout << "Tak" << endl;
        else
            cout << "Nie" << endl;
    }

    return 0;
}