#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i, n) for(int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i) #define ALL(x) (x).begin(), (x).end() #define INF 2000000000 //#define int long long int #ifdef LOCAL #define eprintf(...) fprintf(stdout, __VA_ARGS__) #else #define eprintf(...) 0 #endif using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef unsigned int uint; int main() { map mp; //vector v(5); int t; REP(i, 5) { cin >> t; mp[t]++; } int c2 = 0; int c3 = 0; for(auto m : mp) { if(m.second == 2) { c2++; } else if(m.second == 3) { c3++; } } if(c2 >= 1 && c3 >= 1) { cout << "FULL HOUSE" << endl; } else if(c3 >= 1) { cout << "THREE CARD" << endl; } else if(c2 >= 2) { cout << "TWO PAIR" << endl; } else if(c2 >= 1) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }