inp1 = list(input().split()) inp1.sort() base = inp1[0] nub = [] count = 0 lim = 0 for s in inp1: lim = lim + 1 if base == s: count = count + 1 else: nub.append(count) count = 1 base = s if lim == 5: nub.append(count) nub.sort(reverse=True) if nub[0] == 3: if nub[1] == 2: a = "FULL HOUSE" else: a = "THREE CARD" elif nub[0] == 2: if nub[1] == 2: a = "TWO PAIR" else: a = "ONE PAIR" else: a = "NO HAND" print(a)