using System;

namespace zadatak_3
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            int[] n = new int[t];
            int[] m = new int[t];
            int[] k = new int[t];
            int[] niz;
            int x = 0;
            bool ok = true;
            for (int i = 0; i < t; i++)
            {
                string[] s = Console.ReadLine().Split();
                n[i] = int.Parse(s[0]);
                m[i] = int.Parse(s[1]);
                k[i] = int.Parse(s[2]);
            }
            for (int i = 0; i < t; i++)
            {
                niz = new int[k[i]];
                if (n[i] < k[i] || m[i] < n[i])
                    ok = false;
                else
                {
                    double c = n[i] / k[i];
                    for (int j = 0; j < k[i]; j++)
                    {
                        niz[j] = 1;
                    }
                    x = n[i] - k[i];
                    if (x == 0)
                        break;
                    else
                    {
                        for (int j = 0; j < k[i]; j++)
                        {
                            if (x > 0)
                            {
                                niz[j] += 1;
                                x--;
                            }
                            else
                                break;
                        }
                    }
                    ok = true;
                }
                if (ok)
                    Console.WriteLine("Tak");
                else
                    Console.WriteLine("Nie");
            }
        }
    }
}