#include <iostream>

using namespace std;

int main() {
	int t1[10], n, m, k, t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> n >> m >> k;
		int a = m / n;
		if ((a < 2 && n / k > 1) || m - n < 0) {
			t1[i] = 0; continue;
		}
		int b = n / k;
		int c = b * a;
		if (c % 2 == 0)
			c = (c / 2) - 1;
		if (c % 2 == 1)
			c = c / 2;
		if (b - c)
			t1[i] = 1;
		else
			t1[i] = 0;
	}
	for (int i = 0; i < t; i++) {
		if (t1[i] == 1)
			cout << "Tak" << endl;
		else
			cout << "Nie" << endl;
	}

	return 0;
}