import collections A = list(map(int, input().split())) C = collections.Counter(A) D = list(C.values()) three = len(list(filter(lambda x: x == 3, D))) two = len(list(filter(lambda x: x == 2, D))) msg="NO HAND" if three == 1: if two == 1: msg="FULL HOUSE" else: msg="THREE CARD" else: if two == 2: msg="TWO PAIR" elif two == 1: msg="ONE PAIR" print(msg)