#include #define LL long long #define ULL unsigned long long #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; multiset st; REP( i, 5 ) { cin >> N; st.insert(N); } int res{}; for( const auto& x : st ) { if( st.count(x) == 3 ) { res += 3; } else if( st.count(x) == 2 ) { res += 2; } else if( st.count(x) == 1 ) { res += 1; } } cout << ( res == 13 ? "FULL HOUSE" : res == 11 ? "THREE CARD" : res == 9 ? "TWO PAIR" : res == 7 ? "ONE PAIR" : "NO HAND" ) << endl; return 0; }