#include using namespace std; int main() { int A[5]; for(int i = 0; i < 5; i++) { cin >> A[i]; } sort(A, A + 5); do { if(A[0] == A[1] && A[1] == A[2] && A[2] != A[3] && A[3] == A[4]) { cout << "FULL HOUSE" << endl; return(0); } } while(next_permutation(A, A + 5)); do { if(A[0] == A[1] && A[1] == A[2] && A[2] != A[3] && A[2] != A[4]) { cout << "THREE CARD" << endl; return(0); } } while(next_permutation(A, A + 5)); do { if(A[0] == A[1] && A[1] != A[2] && A[2] == A[3] && A[0] != A[4] && A[2] != A[4]) { cout << "TWO PAIR" << endl; return(0); } } while(next_permutation(A, A + 5)); do { if(A[0] == A[1] && A[0] != A[2] && A[0] != A[3] && A[0] != A[4]) { cout << "ONE PAIR" << endl; return(0); } } while(next_permutation(A, A + 5)); cout << "NO HAND" << endl; }