#include using namespace std; int main() { int A[5]; int val[13] = { 0 }; int twop_flag1 = 0, twop_flag2 = 0, thrp_flag = 0; for (int i = 0; i < 5; i++) { cin >> A[i]; val[A[i] - 1]++; } for (int i = 0; i < 13;i++) { if (val[i] == 3) { thrp_flag = 1; } if (val[i] == 2) { if (twop_flag1 == 0) { twop_flag1 = 1; } else { twop_flag2 = 1; } } } if (thrp_flag == 1) { if (twop_flag1 == 1) { cout << "FULL HOUSE" << endl; } else { cout << "THREE CARD" << endl; } } else if (twop_flag1 == 1) { if (twop_flag2 == 1) { cout << "TWO PAIR" << endl; } else { cout << "ONE PAIR" << endl; } } else { cout << "NO HAND" << endl; } return 0; }