#include #include using namespace std; int main(int argc, const char* argv[]) { int A[5]; for (auto&& a : A) cin >> a; map m; for (auto&& a : A) m[a]++; string ret = "NO HAND"; map cnts; for (auto&& v : m) cnts[v.second]++; if (cnts[3] == 1 && cnts[1] == 2) ret = "THREE CARD"; if (cnts[2] == 2 && cnts[1] == 1) ret = "TWO PAIR"; if (cnts[2] == 1 && cnts[1] == 3) ret = "ONE PAIR"; if (cnts[3] == 1 && cnts[2] == 1) ret = "FULL HOUSE"; cout << ret << endl; return 0; }