#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() using namespace std; typedef long long LL; typedef vector VI; int main() { int k[14] = {}; REP(i, 5) { int a; cin >> a; k[a]++; } sort(k, k + 14, greater()); if (k[0] == 3) { if (k[1] == 2) { cout << "FULL HOUSE" << endl; return 0; } cout << "THREE CARD" << endl; return 0; } if (k[0] == 2) { if (k[1] == 2) { cout << "TWO PAIR" << endl; return 0; } cout << "ONE PAIR" << endl; return 0; } cout << "NO HAND" << endl; return 0; }