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