#include using namespace std; typedef vector VI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) int a[13]; int main(){ REP(i,5){ int n;cin >> n; a[n-1]++; } VI v; REP(i,13) if(a[i]>0) v.push_back(a[i]); sort(v.begin(), v.end(), greater()); cout << [&](){ if(v[0] == 3 && v[1] == 2) return "FULL HOUSE"; if(v[0] == 3) return "THREE CARD"; if(v[0] == 2 && v[1] == 2) return "TWO PAIR"; if(v[0] == 2) return "ONE PAIR"; return "NO HAND"; }() << endl; }