#include <stdio.h>
#include <stdlib.h>



int main() {
	
	int t, n[10], m[10], k[10];
	
	scanf("%d", &t);
	
	int i;
	
	
	
	for(i = 0; i < t; i++){
		scanf("%d %d %d", &n[i], &m[i], &k[i]);
	}
	
	//int l = strlen(n);
	
	for(i = 0; i < t; i++){
	
	if(k[i] > n[i]){
		printf("Nei\n");
	}else if(n[i] == m[i]) {
		printf("Nei\n");
	}else if(n[i] > m[i]){
		printf("Nei\n");
	}else if(k[i] < n[i]){
		printf("Tak\n");
	}else if(n[i] < m[i]){
		printf("Tak\n");
	}else if(n[i] > m[i]){
		printf("Nei\n");
	}}
	
	
	return 0;
}