#include using namespace std; //-------------------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX/3 //-------------------------------------------- const double EPS = 1e-14; const double PI = acos(-1.0); //-------------------------------------------- // typedef pair p; vector

v; int a[6]; bool flag = true; int main(){ REP (i,5) scanf("%d",&a[i]); v.push_back(make_pair(1,a[0])); FOR (i, 1, 5) { flag = true; for (auto itr = v.begin(); itr != v.end(); itr++) { if (itr->second == a[i]) { itr->first += 1; flag = false; break; } } if (flag) v.push_back(make_pair(1, a[i])); } sort (v.begin(), v.end(), greater

()); if (v.front().first == 3 && v.back().first == 2) printf("FULL HOUSE\n"); else if (v.front().first == 3 && v.back().first == 1) printf("THREE CARD\n"); else if (v.front().first == 2 && v.size() == 3) printf("TWO PAIR\n"); else if (v.front().first == 2 && v.size() == 4) printf("ONE PAIR\n"); else printf("NO HAND\n"); }