from collections import Counter hand = ['FULL HOUSE', 'THREE CARD', 'TWO PAIR', 'ONE PAIR', 'NO HAND'] pair2 = 0 pair3 = 0 l = [int(x) for x in input().split()] i = Counter(l) for x in i.most_common(): if x[1] == 3: pair3 += 1 elif x[1] == 2: pair2 += 1 else: continue if pair2 == 1 and pair3 == 1: print(hand[0]) elif pair3 == 1: print(hand[1]) elif pair2 == 2: print(hand[2]) elif pair2 == 1: print(hand[3]) else: print(hand[4])