#include <iostream>
int f(int a) {
	int s = 0;
	while (a > 0) s += a--;
	return s;
}
bool proveri(int d, int b, int g) {
	int m = 0;
	int o = d / g;
	m += g*f(o) + (d%g)*(o+1);
	return b >= m;
}
int main() {
	int t;
	std::cin >> t;
	for (int x = 0; x < t; x++) {
		int g, d, b;
		std::cin >> d >> b >> g;
		std::cout<<(proveri(d,b,g)?"Tak":"Nie")<<"\n";
	}
}