#include #define rep(i,n) for(int i=0;i<(n);++i) #define ALL(A) A.begin(), A.end() using namespace std; typedef long long ll; typedef pair P; enum hand{ NO_HAND = 0x00, FULL_HOUSE = 0x05, THREE_CARD = 0x04, TWO_PAIR = 0x02, ONE_PAIR = 0x01 }; int main() { ios_base::sync_with_stdio(0); cin.tie(0); map cnt; cnt.clear(); int a[5] = {0}; rep (i, 5){ int a; cin >> a; ++cnt[a]; } // end rep int res = NO_HAND; map::iterator it = cnt.begin(); for (; it != cnt.end(); ++it){ int pairs = (*it).second; if (pairs == 2) res += ONE_PAIR; if (pairs == 3) res |= THREE_CARD; } // end for if (res == FULL_HOUSE){ cout << "FULL HOUSE" << endl; }else if (res == THREE_CARD){ cout << "THREE CARD" << endl; }else if (res == TWO_PAIR){ cout << "TWO PAIR" << endl; }else if (res == ONE_PAIR){ cout << "ONE PAIR" << endl; }else{ cout << "NO HAND" << endl; } // end if return 0; }