using System;
					
public class Program
{
	public static void Main()
	{
		int n = 0;
		int k = 0;
		int m = 0;
		int buupg = 0;
		int trenb = 1;
		int suma = 0;
		int t = int.Parse(Console.ReadLine());
		string[] niz2 = new string[t];
		int[,] niz = new int[t, 3];
		for (int i = 0; i< t; i++)
		{
			string[] h = Console.ReadLine().Split();
			niz[i, 0] = int.Parse(h[0]);
			niz[i, 1] = int.Parse(h[1]);
			niz[i, 2] = int.Parse(h[2]);
		}
		for (int f = 0; f < t; f++)
		{
			n = niz[f, 0];
			m = niz[f, 1];
			k = niz[f, 2];
			buupg = n - (k-1);
			for (int c = 0; c< buupg; c++)
			{
				suma += trenb;
				trenb += 1;
			}
			for (int z = 0; z < (k-2); z++)
			{
				suma += 1;
			}
			if (m - suma > 0)
			{
				niz2[f] = "Tak";
			}
			else
			{
				niz2[f] = "Nie";
			}
		}
		for (int i = 0; i < t; i++)
		{
			Console.WriteLine(niz2[i]);
		}
		
	}
}