#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; string solve() { int x; vector v(14); rep(i, 0, 5) { cin >> x; v[x]++; } int c3 = 0, c2 = 0; rep(i, 1, 14) { if (v[i] == 3) c3++; if (v[i] == 2) c2++; } string ans = "NO HAND"; if (c3 == 1 && c2 == 1) { ans = "FULL HOUSE"; } else if (c3 == 1 && c2 == 0) { ans = "THREE CARD"; } else if (c3 == 0 && c2 == 2) { ans = "TWO PAIR"; } else if (c3 == 0 && c2 == 1) { ans = "ONE PAIR"; } return ans; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << solve() << endl; getchar(); }