#include int main(void){ int card[5],max,maxpoint,temp,onepairCheck = 0; for(int i = 0; i < 5; i++)scanf("%d",&card[i]); for(int i = 0; i < 5; i++){ max = 0; for(int j = i; j < 5; j++){ if(max < card[j]){ max = card[j]; maxpoint = j; } } temp = card[i]; card[i] = card[maxpoint]; card[maxpoint] = temp; } if(card[0] == card[1] && card[1] == card[2] && card[2] != card[3] && card[3] == card[4])printf("FULL HOUSE\n"); else if(card[0] == card[1] && card[1] != card[2] && card[2] == card[3] && card[3] == card[4])printf("FULL HOUSE\n"); else if(card[0] == card[1] && card[1] == card[2] && card[2] != card[3])printf("THREE CARD\n"); else if(card[1] == card[2] && card[2] == card[3] && card[2] != card[4])printf("THREE CARD\n"); else if(card[1] == card[2] && card[2] == card[3] && card[2] != card[0])printf("THREE CARD\n"); else if(card[2] == card[3] && card[3] == card[4] && card[4] != card[1])printf("THREE CARD\n"); else if(card[0] == card[1] && card[2] == card[3] && card[3] != card[4])printf("TWO PAIR\n"); else if(card[1] == card[2] && card[3] == card[4] && card[4] != card[0])printf("TWO PAIR\n"); else if(card[0] == card[1] && card[3] == card[4] && card[4] != card[0])printf("TWO PAIR\n"); else{ for(int i = 0; i < 4; i++){ if(card[i] == card[i + 1]){ int count = 0; for(int j = 0; j < 5; j++){ if(card[j] != card[i])count++; } if(count == 3){ printf("ONE PAIR\n"); onepairCheck = 1; break; } } } if(onepairCheck == 0)printf("NO HAND\n"); } return 0; }