#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) #define ALL(a) (a).begin(),(a).end() int N,T; signed main() { map M; REP(i,5) { cin >> T; M[T]++; } vector K; for (auto&& kv : M) K.push_back(kv.second); sort(ALL(K), greater()); if (K[0] == 3 && K[1] == 2) { cout << "FULL HOUSE" << endl; } else if (K[0] == 3) { cout << "THREE CARD" << endl; } else if (K[0] == 2 && K[1] == 2) { cout << "TWO PAIR" << endl; } else if (K[0] == 2) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }