using System;
using System.Collections.Generic;
using System.Linq;


class Project
{
    static void Main()
    {
        int x = int.Parse(Console.ReadLine());
        int[,] a = new int[x, 3];
        for(int i = 0; i < x; i++)
        {
            string[] s = Console.ReadLine().Split();
            for(int j = 0; j < 3; j++)
            {
                a[i, j] = int.Parse(s[j]);
            }
        }

        for (int i = 0; i < x; i++)
        {
            int GlavniBroj = a[i, 1] / a[i, 0];
            int Ostatak = GlavniBroj + a[i, 1] % a[i, 0];
            if(Ostatak - ((a[i, 0] - a[i, 2]) / 2) <= 0) { Console.WriteLine("Nie"); }
            else if(a[i, 2] == 1 && a[i, 0] == a[i, 1]) { Console.WriteLine("Nie"); }
            else { Console.WriteLine("Tak"); }
        }
    }
}