import collections l = collections.Counter(list(input().split())) v, c = zip(*l.most_common()) r = "NO HAND" if c[0] == 3: if c[1] == 2: r = "FULL HOUSE" else: r = "THREE CARD" if c[0] == 2: if c[1] == 2: r = "TWO PAIR" else: r = "ONE PAIR" print(r)