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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            int i = 0;
            string[] niz = new string[t];
            while (i < t)
            {
                string str = Console.ReadLine();
                string[] s = str.Split();
                long n = long.Parse(s[0]);
                long m = long.Parse(s[1]);
                long k = long.Parse(s[2]);
                long d = k - 1;
              
                if (((n - d) * (n - d + 1) / 2) + d < m) niz[i] = "Tak";
                else niz[i] = "Nie";
                i++;

            }
            i = 0;
            while (i < t)
            {
                Console.WriteLine(niz[i]);
                i++;
            }
         //   Console.ReadLine();
        }
    }
}