#include <stdio.h>

int main(){
    int num[5], list[14] = {0};
    int i, three = 0, two = 0;

    for(i = 0; i < 5; i++){
        scanf("%d", &num[i]);
        list[num[i]]++;
    }
    for(i = 1; i < 14; i++){
        if(list[i] == 3){
            three++;
        }else if(list[i] == 2){
            two++;
        }
    }
    if(three == 1 && two == 1){
        printf("FULL HOUSE\n");
    }else if(three == 1){
        printf("THREE CARD\n");
    }else if(two == 2){
        printf("TWO PAIR\n");
    }else if(two == 1){
        printf("ONE PAIR\n");
    }else{
        printf("NO HAND\n");
    }

    return 0;

}