using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lecture { class Program { static void Main(string[] args) { int n = 5; int[] syamu = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int []count = new int [14]; for (int i = 1; i <= 13; i++) { for (int j = 0; j < n; j++) { if (syamu[j] == i) { count[i]++; } } } int w = 0; int t = 0; for (int i = 1; i <= 13; i++) { if (count[i] == 3) { t++; } else if (count[i] == 2) { w++; } } if (t == 1 && w == 1) { Console.WriteLine("FULL HOUSE"); } else if (t == 1) { Console.WriteLine("THREE CARD"); } else if (w == 2) { Console.WriteLine("TWO PAIR"); } else if (w == 1) { Console.WriteLine("ONE PAIR"); } else { Console.WriteLine("NO HAND"); } } } }