#include "bits/stdc++.h" #define SORT(vec) sort(vec.begin(), vec.end()); using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); // -------------------------------------- vector A; for (int i = 0; i < 5; i++) { int a; cin >> a; A.push_back(a); } SORT(A); int hand[2] = {0}; int j = 0; for (int i = 0; i < 4; i++) { if (A[i] == A[i+1]) { hand[j] += 1; }else if (hand[j] != 0 && A[i] != A[i+1]){ j = 1; } // cout << hand[0] << " " << hand[1] << "\n"; } string ans; switch (hand[0]) { case 1: switch (hand[1]) { case 0: ans = "ONE PAIR"; break; case 1: ans = "TWO PAIR"; break; case 2: ans = "FULL HOUSE"; break; } break; case 2: switch (hand[1]) { case 0: ans = "THREE CARD"; break; case 1: ans = "FULL HOUSE"; break; } break; default: ans = "NO HAND"; break; } cout << ans << "\n"; }