// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input int A[5]; rep(i, 5) cin >> A[i]; // Judge vector cnt(14); rep(i, 5) ++cnt[A[i]]; sort(cnt.begin(), cnt.end()); string hand; rep(i, 13) if (cnt[i + 1] != 0) hand += to_string(cnt[i + 1]); // Output if (hand == "23") cout << "FULL HOUSE" << endl; else if (hand == "113") cout << "THREE CARD" << endl; else if (hand == "122") cout << "TWO PAIR" << endl; else if (hand == "1112") cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; }