from collections import Counter c = Counter(raw_input().split(" ")).most_common() r = "NO HAND" if len(c) > 1: if c[0][1] == 3: if c[1][1] == 2: r = "FULL HOUSE" else: r = "THREE CARD" elif c[0][1] == 2: if c[1][1] == 2: r = "TWO PAIR" else: r = "ONE PAIR" print r