import collections a = list(map(int,input().split())) c = collections.Counter(a) list_per_element = c.most_common() length = len(list_per_element) res = 'apple' if length == 2 and list_per_element[0][1] == 3: res = 'FULL HOUSE' elif length == 3: if list_per_element[0][1] == list_per_element[1][1]: res = 'TWO PAIR' else: res = 'THREE CARD' elif length == 4: res = 'ONE PAIR' else: res = 'NO HAND' print(res)