import collections txt = input() c = collections.Counter(list(txt.split())) values, counts = zip(*c.most_common()) result = "NO HAND" if counts[0] == 3 and counts[1] == 2: result = "FULL HOUSE" elif counts[0] == 3 and counts[1] != 2: result = "THREE CARD" elif counts[0] == 2 and counts[1] == 2: result = "TWO PAIR" elif counts[0] == 2 and counts[1] != 2: result = "ONE PAIR" print(result)