import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashMap map = new HashMap<>(); for (int i = 0; i < 5; i++) { int x = sc.nextInt(); map.put(x, map.getOrDefault(x, 0) + 1); } int three = 0; int two = 0; for (int x : map.values()) { if (x == 3) { three++; } else if (x == 2) { two++; } } String ans; if (three == 1 && two == 1) { ans = "FULL HOUSE"; } else if (three == 1) { ans = "THREE CARD"; } else if (two == 2) { ans = "TWO PAIR"; } else if (two == 1) { ans = "ONE PAIR"; } else { ans = "NO HAND"; } System.out.println(ans); } }