lst = input().strip().split(' ')

dic = {}

for i in lst:
  try:
    tmp = dic[i]
    dic[i] += 1
  except:
    dic[i] = 1

lst = []
for i in dic.values():
  lst.append(i)

lst = sorted(lst, reverse = True)

txt = ''
if len(lst) == 4:
  txt = 'ONE PAIR'
elif len(lst) == 3:
  if lst[0] == 2:
    txt = 'TWO PAIR'
  elif lst[0] == 3:
    txt = 'THREE CARD'
  else:
    txt = 'NO HAND'
elif len(lst) == 2:
  txt = 'FULL HOUSE'
else:
  txt = 'NO HAND'

print(txt)