s = sorted(list(input().split())) r = sorted([s.count(x) for x in set(s)]) if r == [1, 2, 2]: ans = "TWO PAIR" elif r == [2,3]: ans = "FULL HOUSE" elif 2 in r: ans = "ONE PAIR" elif 3 in r: ans = "THREE CARD" else: ans = "NO PAIR" print(ans)