from itertools import groupby card = sorted([int(x) for x in input().split()]) pats = { (2, 3): "FULL HOUSE", (1, 1, 3): "THREE CARD", (1, 2, 2): "TWO PAIR", (1, 1, 1, 2): "ONE PAIR", (1, 1, 1, 1, 1): "NO HAND", (1, 4): "NO HAND", (5,): "NO HAND" } hand = tuple(sorted([len(list(g)) for k, g in groupby(card)])) print(pats[hand])