import java.util.*; class No0227{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] a = new int[13]; int temp; int cnt3 = 0; int cnt2 = 0; for(int i = 0; i < 5; i++){ temp = sc.nextInt() - 1; a[temp]++; } for(int i = 0; i < a.length; i++){ if(a[i] == 3){ cnt3++; }else if(a[i] == 2){ cnt2++; } } if(cnt3 == 1 && cnt2 == 1){ System.out.println("FULL HOUSE"); }else if(cnt3 == 1){ System.out.println("THREE CARD"); }else if(cnt2 == 2){ System.out.println("TWO PAIR"); }else if(cnt2 == 1){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }