package yukicoder; import java.util.Scanner; public class Yuki227 { public static void main (String[] args) { Scanner scan = new Scanner(System.in); int[] sc_array = new int[5]; int[] card_array = new int[13]; for (int i = 0; i < 5; i++) { sc_array[i] = scan.nextInt(); card_array[sc_array[i]] += 1; } scan.close(); int THREE_CARD = 0; int ONE_PAIR = 0; for (int i = 0; i < card_array.length; i++) { if(card_array[i] == 0){ continue; } if(card_array[i] % 3 == 0){ THREE_CARD += card_array[i]/3; }else if(card_array[i] % 2 == 0 ){ ONE_PAIR += card_array[i]/2; } } if(THREE_CARD >= 1 && ONE_PAIR >= 1 ){ System.out.println("FULL HOUSE"); }else if(THREE_CARD >= 1){ System.out.println("THREE CARD"); }else if(ONE_PAIR >= 2){ System.out.println("TWO PAIR"); }else if(ONE_PAIR >= 1){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }