import collections def card_input(): txt = "1 2 5 5 5" cards = txt.split() return cards def judge(cards): c = collections.Counter(cards) 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" return result print(judge(card_input()))