import collections c = collections.Counter(list(input().split())) vs, cs = zip(*c.most_common()) h = ("NO HAND","FULL HOUSE","THREE CARD","TWO PAIR","ONE PAIR") r = 0 if cs[0] == 3 and cs[1] == 2: r += 1 elif cs[0] == 3 and cs[1] != 2: r += 2 elif cs[0] == 2 and cs[1] == 2: r += 3 elif cs[0] == 2 and cs[1] != 2: r += 4 print(h[r])