using System;

namespace Ekskurzija
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int t = Convert.ToInt32(Console.ReadLine());
            bool[] r = new bool[t];
            for(int i = 0; i < t; i++)
            {
                string[] values = Console.ReadLine().Split(' ');
                int n = Convert.ToInt32(values[0]);
                Int64 m = Convert.ToInt64(values[1]);
                int k = Convert.ToInt32(values[2]);
                int br = (int)(n != 1 ? ((n - 1) % k == 0 ? (n - 1) / k : Math.Floor((double)(n - 1) / k) + 1) : 1);
                if ((m / n) - br > 0) r[i] = true; else r[i] = false;
            }
            foreach (bool i in r) if (i) Console.WriteLine("Tak"); else Console.Write("Nei");
        }
    }
}