#include #include #include #include #define REP(i,n) for(int i=0; i<(int)(n); i++) using namespace std; inline int getInt(){ int s; scanf("%d", &s); return s; } int main(){ map m; REP(i,5) m[getInt()]++; int three = 0; int two = 0; for(auto a : m){ if(a.second == 3) three++; if(a.second == 2) two++; } if(three && two){ puts("FULL HOUSE"); }else if(three){ puts("THREE CARD"); }else if(two == 2){ puts("TWO PAIR"); }else if(two){ puts("ONE PAIR"); }else{ puts("NO HAND"); } return 0; }