A = [int(i) for i in input().split()] A.sort() tw = 0 th = 0 card = 0 while card < 5: if A.count(A[card]) == 2: tw += 1 card += 2 elif A.count(A[card]) == 3: th += 1 card += 3 else: card += 1 if tw == 1 and th == 1: print("FULL HOUSE") elif tw == 0 and th == 1: print("THREE CARD") elif tw == 2 and th == 0: print("TWO PAIR") elif tw == 1 and th == 0: print("ONE PAIR") else: print("NO HAND")