A = map(int,raw_input().split()) li = [0 for i in range(14)] setA = set(A) for a in A: li[a] += 1 ans = 'NO HAND' if len(setA) == 2 and ((li[list(setA)[0]] >= 2 and li[list(setA)[1]] >= 3) or (li[list(setA)[0]] >= 3 and li[list(setA)[1]] >= 2)): ans = 'FULL HOUSE' elif len(setA) == 3 and (li[list(setA)[0]] >= 3 or li[list(setA)[1]] >= 3 or li[list(setA)[2]] >= 3): ans = 'THREE CARD' elif len(setA) == 3: ans = 'TWO PAIR' elif len(setA) == 4: ans = 'ONE PAIR' print ans