#include <iostream>
#define MOD 1000000007
using namespace std;

main(){
	int t;
	int k;
	long long m,n;
	cin>>t;
	while(t--){
		
		cin>>n>>m>>k;
		long long sum;
		sum=(n*(n+1))/2;
		
		if(n>m || k>m || n<k || sum>m)
			cout<<"Nie"<<endl;
		else
		 cout<<"Tak"<<endl;
		
	}
}