#include #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; template ostream& operator<<(ostream& os, const vector& v) { os << "sz:" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = (ll)1e9 + 7LL; template constexpr T INF = numeric_limits::max() / 64; int main() { cin.tie(0); ios::sync_with_stdio(false); vector c(5); for (int i = 0; i < 5; i++) { cin >> c[i]; } sort(c.begin(), c.end()); auto zip = c; zip.erase(unique(zip.begin(), zip.end()), zip.end()); if (zip.size() == 1) { cout << "NO HAND" << endl; } else if (zip.size() == 2) { if (c[1] == c[2] and c[2] == c[3]) { cout << "NO HAND" << endl; } else { cout << "FULL HOUSE" << endl; } } else if (zip.size() == 3) { for (int i = 0; i < 3; i++) { if (c[i] == c[i + 1] and c[i + 1] == c[i + 2]) { cout << "THREE CARD" << endl; return 0; } } cout << "TWO PAIR" << endl; } else if (zip.size() == 4) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }