# -*- coding:utf-8 -*- hands = { "2 3": "FULL HOUSE", "3": "TRHEE CARD", "2 2": "TWO PAIR", "2": "ONE PAIR" } if __name__ == '__main__': an = tuple(map(int, input().split())) ad = {k: 0 for k in set(an)} for a in an: ad[a] += 1 k = " ".join(map(str, sorted(filter(lambda v: 2 <= v, ad.values())))) print(hands[k] if k in hands.keys() else "NO HAND")