import java.io.*; import java.util.*; import java.lang.Math; class N227 { public static void main(String[] args) throws Exception{ try (Scanner sc1 = new Scanner(System.in)) { int[] impnum = new int[5]; int[] huriwake = new int[13]; int three = 0; int two = 0; // 入力 impnum[0] = Integer.parseInt(sc1.next()); impnum[1] = Integer.parseInt(sc1.next()); impnum[2] = Integer.parseInt(sc1.next()); impnum[3] = Integer.parseInt(sc1.next()); impnum[4] = Integer.parseInt(sc1.next()); for(int i = 0;i < 5;i++){ huriwake[impnum[i] - 1]++; } for(int j = 0;j < 13;j++){ switch(huriwake[j]){ case 3: three++; break; case 2: two++; break; } } String result = "NO HAND"; if(three == 1 && two == 1){ result = "FULL HOUSE" ; }else if(three == 1){ result = "THREE CARD" ; }else if(two == 2){ result = "TWO PAIR" ; }else if(two == 1){ result = "ONE PAIR" ; } System.out.println(result); } } }