#include using namespace std; int main(void) {//バカの手法って感じ、絶対にいい方法がありそう, //フラグとか int i,s,temp, test[5]; for (i = 0; i < 5;i++) cin >> test[i]; for (i = 0; i < 5; ++i) { for (int s = 4; s > i; --s) { if (test[s] < test[s - 1]) { temp = test[s - 1]; test[s - 1] = test[s]; test[s] = temp; } } } if (test[0] == test[3] || test[1] ==test[4]) cout << "NO HAND"; else if (test[0] == test[1] && test[2] == test[4] || test[0] == test[2] && test[3] == test[4]) cout << "FULL HOUSE"; else if (test[0] == test[2] || test[1] == test[3] || test[2] == test[4]) cout << "THREE CARD"; else if (test[0] == test[1] && (test[2] == test[3] || test[3] == test[4]) || test[1] == test[2] && test[3] == test[4]) cout << "TWO PAIR"; else if (test[0] == test[1] || test[1] == test[2] || test[2] == test[3] || test[3] == test[4]) cout << "ONE PAIR"; else cout << "NO HAND"; return 0; }