#include <iostream>

using namespace std;

int main () {
	
	long long B, U, G;
	int T;
	bool niz[11];
	
	cin >> T;
	
	for (int i = 0; i < T; i++) {
	
		cin >> U >> B >> G;
		
		long long visak = U - (U % G); 
	
		long long ban = 1;
		long long br = 1;
	
		while (G * br < U % G) {
		
			br++;
			ban += br;
		
		}
		
		niz[i] = (ban * G + visak * (br + 1) <= B);
	
	}
	
	for (int i = 0; i < T; i++)
	if (!niz[i]) {
		cout << "Nie" << endl;
	}
	else {
		cout << "Tak" << endl;
	}
	return 0;
}