#include #include #include #define REP(i, a, b) for (int i = int(a); i < int(b); i++) using namespace std; typedef long long int lli; int main() { int A[13] = {0}; REP (i, 0, 5) { int a; cin >> a; a--; A[a]++; } int three = 0, two = 0; REP (i, 0, 13) { if (A[i] == 3) three++; else if (A[i] == 2) two++; } if (three == 1 && two == 1) cout << "FULL HOUSE" << endl; else if (three == 1) cout << "THREE CARD" << endl; else if (two == 2) cout << "TWO PAIR" << endl; else if (two == 1) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; return 0; }