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

int main()
{
    int T, N, M, K, i, j;
    scanf("%d", &T);
    int tomb[T][4];
    for (i=0; i<T; i++) {
        tomb[i][3] = 0;
        for (j=0; j<3; j++) {
            scanf("%d", &tomb[i][j]);
        }
    }

    for (i=0; i<T; i++) {

        if (tomb[i][0] < tomb[i][2]) { // More group than person
            tomb[i][3] = 1; // Nie
        }
        if (tomb[i][0] > tomb[i][1]) { // More player than banana
            tomb[i][3] = 1; // Nie
        }
        if (tomb[i][0] == tomb[i][1] && tomb[i][2] < tomb[i][0]) { // Equal player than banana but not equal groups
            tomb[i][3] = 1; // Nie
        }
    }

    i=0;
    while(i<T) {
        if (tomb[i][3] == 1) {
            printf("Nie\n");
            i++;
        }
        else {
            printf("Tak\n");
            i++;
        }
    }

    return 0;
}