#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; string solve(vector v) { map m; for (int i = 0; i < v.size(); ++i) { m[v[i]] += 1; } if (m.size() == 2) { // FULL HOUSE bool onePair = false; bool threeCard = false; for (auto kv:m) { if (kv.second == 3) { threeCard = true; } if (kv.second == 2) { onePair = true; } } if (onePair and threeCard) { return "FULL HOUSE"; } return "NO HAND"; } else if (m.size() == 3) { // THREE CARD bool isThreeCard = false; for (auto kv:m) { if (kv.second == 3) { isThreeCard = true; } } if (isThreeCard) { return "THREE CARD"; } // TWO PAIR int tmpCnt = 0; for (auto kv:m) { if (kv.second == 2) { tmpCnt += 1; } } if (tmpCnt == 2) { return "TWO PAIR"; } return "NO HAND"; } else if (m.size() == 4) { return "ONE PAIR"; } else { return "NO HAND"; } } int main() { vector v; for (int i = 0; i < 5; ++i) { int A; cin >> A; v.push_back(A); } cout << solve(v) << endl; return 0; }