import java.util.*; import java.lang.*; import java.io.*; class Ideone{ public static void main(String[] args) throws Exception{ // your code goes here BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] lines = br.readLine().split(" "); int[] cards = new int[13]; cards[Integer.parseInt(lines[0])-1]++; cards[Integer.parseInt(lines[1])-1]++; cards[Integer.parseInt(lines[2])-1]++; cards[Integer.parseInt(lines[3])-1]++; cards[Integer.parseInt(lines[4])-1]++; int two = 0; int three = 0; for(int n:cards){ if(n==2){ two++; }else if(n==3){ three++; } } if(three==1 && two==1){ System.out.println("FULL HOUSE"); }else if(three==1){ System.out.println("THREE CARD"); }else if(two==2){ System.out.println("TWO PAIR"); }else if(two==1){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }