a = [int(n)-1 for n in input().split()] cnt = [0]*13 for i in a: cnt[i] += 1 two = [n for n in cnt if n == 2] three = [n for n in cnt if n == 3] f = len(two)*2 + len(three)*3 print(["NO HAND", "", "ONE PAIR", "THREE CARD", "TWO PAIR", "FULL HOUSE"][f])