#include<iostream>
using namespace std;

class test{
private:
    int N;
    int M;
    int K;
    bool mogucnost;
public:
    test()
    {
        N = 0;
        M = 0;
        K = 0;
        mogucnost = false;
    }

    test(int N, int M, int K)
    {
        this->N = N;
        this->M = M;
        this->K = K;
        this->mogucnost=mogucnost;
    }

	void unos();
	void moguc();
	
	bool get_mogucnost(){
		return mogucnost;
	}
};

void test::unos()
{
    cin >> N >> M >> K;
}

void test::moguc(){
	int fakt=0;
	for(int j=1 ; j<=N ; j++){
		fakt+=j;
	}
	if(fakt <= M){
		mogucnost = true;
	}
		
}

main(){
    int p;
    test t[10];
    cin>>p;
    for (int i = 0; i < p; i++)
    {
        t[i].unos();
    }
    for (int i=0; i<p ; i++){
    	t[i].moguc();
	}
	for (int i=0 ; i<p; i++){
		if(t[i].get_mogucnost() == true){
			cout<<"Tak\n";
		}else{
			cout<<"Nie\n";
		}
	}
    
    
    return 0;
}