import java.util.Arrays; import java.util.Scanner; public class No_227 { static String judge(int[] cn) { Arrays.sort(cn); int a, b, c, d, e; a = cn[13]; b = cn[12]; c = cn[11]; d = cn[10]; e = cn[9]; if (a == 3 && b == 2) return "FULL HOUSE"; else if (a == 3) return "THREE CARD"; else if (a == 2 && b == 2) return "TWO PAIR"; else if (a == 2) return "ONE PAIR"; else return "NO HAND"; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] cardNumber = new int[14]; for (int i = 0; i < 5; i++) { int a = sc.nextInt(); cardNumber[a]++; } String hand = judge(cardNumber); System.out.println(hand); } }