#include #include using namespace std; int main(void) { int a; map m; for (int i = 0; i < 5; ++i) { cin >> a; m[a]++; } auto it = m.begin(); if (m.size() == 2 && ((*it).second == 2 || (*it).second == 3)) { cout << "FULL HOUSE" << endl; } else if (m.size() == 3) { bool three = false; int cnt = 0; for (auto i = it; i != m.end(); i++) { three |= (*i).second == 3; cnt += (*i).second == 2; } if (three) cout << "THREE CARD" << endl; else if (cnt == 2) cout << "TWO PAIR" << endl; } else if (m.size() == 4) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }