#include #include #include using namespace std; int main() { int a[5] = {}; for (auto &e : a) { cin >> e; } sort(a, a + 5); map amount_by_card{}; for (auto e : a) { ++amount_by_card[e]; } map card_by_amount{}; for (auto [_key, value] : amount_by_card) { ++card_by_amount[value]; } if (card_by_amount[3] == 1 && card_by_amount[2] == 1) { cout << "FULL HOUSE\n"; } else if (card_by_amount[3] == 1) { cout << "THREE CARD\n"; } else if (card_by_amount[2] == 2) { cout << "TWO PAIR\n"; } else if (card_by_amount[2] == 1) { cout << "ONE PAIR\n"; } else { cout << "NO HAND\n"; } return 0; }