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