import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[14]; for(int i = 0; i < 5; i++) { a[sc.nextInt()]++; } int two = 0; int three = 0; for(int i = 1; i < 14; i++) { if(a[i] == 2) { two++; } else if (a[i] == 3) { three++; } } String result = "NO HAND"; if(two == 1 && three == 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); } }