#include #include #include #include #define REP(i,n) for(int i=0;i -1) { str.replace(i, old_s.size(), new_s); } return str; } int count5126(string str, string a) { int i = 0, cnt = 0; if (a == "") { return -1; } while ((i = str.find(a, i)) > -1) { ++cnt; i += a.size(); } return cnt; } vector split5126(string str, string sep){ int s = 0, p = 0; vector v; if (sep == "") { v.push_back(str); return v; } while ((p = str.find(sep, s)) > -1) { v.push_back(str.substr(s, p - s)); s = p + sep.size(); } v.push_back(str.substr(s, str.size())); return v; } string slice5126(string str, int a, int b){ int s = a < 0 ? str.size() + a : a; int e = b < 0 ? str.size() + b : b; e = b == 0 ? str.size() : e; return str.substr(s, (s > e ? s : e) - s); } int main() { map mp; vector v; for (int i = 0; i < 5; ++i){ int j; cin >> j; mp[j] = mp.count(j) == 0 ? 0 : mp[j] + 1; } for (auto i = mp.begin(); i != mp.end(); ++i) { v.push_back(i->second); } sort(ALL(v)); if (v.size() == 2 && v[0] > 1) { cout << "FULL HOUSE" << endl; } else if (v.size() == 3 && v[1] == 2 && v[2] == 2) { cout << "TWO PAIR" << endl; } else if (v[v.size()-1] == 2 && v[v.size()-2] == 1) { cout << "ONE PAIR" << endl; } else if (v[v.size()-1] == 3){ cout << "THREE CARD" << endl; } else { cout << "NO HAND" << endl; } return 0; }