#include int main(void) { int card[6]; int num[6] = {0}; int tmp; int count = 1; int count1 = 0; int count2 = 0; int change = 0; int k1, k2; for ( k1 = 1; k1 <= 5; k1++ ) { scanf("%d", &card[k1]); } for ( k1 = 1; k1 < 5; k1++ ) { for ( k2 = 1; k2 < 5; k2++ ) { if ( card[k2] > card[k2+1] ) { tmp = card[k2]; card[k2] = card[k2+1]; card[k2+1] = tmp; change++; } } } if ( change == 0 ) { puts("NO HAND"); return 0; } for ( k1 = 1; k1 <= 5; k1++ ) { if ( k1 == 5 ) { if ( card[5] == card[4] ) { num[5] = count; } else { break; } } if ( card[k1] == card[k1+1] ) { num[k1] = count; } else if ( card[k1] != card[k1+1] ) { if ( card[k1] == card[k1-1] ) { num[k1] = count; count++; } else if ( card[k1] != card[k1-1] ) { continue; } } } for ( k1 = 1; k1 <= 5; k1++ ) { if ( num[k1] == 1 ) { count1++; } else if ( num[k1] == 2 ) { count2++; } } if ( count1 == 0 ) { if ( count2 == 0 ) { puts("NO HAND"); } } if ( count1 == 3 ) { if (count2 == 2 ) { puts("FULL HOUSE"); } else { puts("THREE CARD"); } } if ( count1 == 2 && count2 == 2 ) { puts("TWO PAIR"); } if ( count1 == 2 && count2 == 0 ) { puts("ONE PAIR"); } if ( count1 == 5 ) { puts("NO HAND"); } return 0; }