import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.stream.Stream; public class No00000227_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] cards = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); int[] cntArr = new int[13]; for(int i = 0; i < 5; i++) cntArr[cards[i]- 1] += 1; int[] resultArr = Arrays.stream(cntArr).filter(x -> x > 1).sorted().toArray(); String result = "NO HAND"; if(resultArr.length == 1) { if(resultArr[0] == 2) result = "ONE PAIR"; if(resultArr[0] == 3) result = "THREE CARD"; } else if(resultArr.length == 2) { if(resultArr[1] == 3) result = "FULL HOUSE"; if(resultArr[1] == 2) result = "TWO PAIR"; } System.out.println(result); } }