#include using namespace std; int main() { int num[5]; int tmp[5][2],now=0; int twoPair = 0,threePair = 0; bool flag = false; for (int i = 0; i < 5; i++) { tmp[i][0] = 0; tmp[i][1] = 0; } for (int i = 0; i < 5; i++) cin>>num[i]; for (int i = 0; i < 5; i++) { flag = false; for (int j = 0; j < i; j++) { if (tmp[j][0] == num[i]) { tmp[j][1]++; flag = true; } } if (!flag) { tmp[now][0] = num[i]; tmp[now][1] = 1; now++; } } for (int i = 0; i < 5; i++) { if (tmp[i][1] == 3) threePair++; else if (tmp[i][1] == 2) twoPair++; } if (threePair) { if (twoPair) cout << "FULL HOUSE"; else cout << "THREE CARD"; } else if (twoPair == 2) cout << "TWO PAIR"; else if (twoPair == 1) cout << "ONE PAIR"; else cout << "NO HAND"; return 0; }