#coding: UTF-8 import sys import re import itertools from collections import deque ### defs ### ### main ### A = list(map(int,sys.stdin.readline().split())) cnt = [0]*13 for a in A: cnt[a-1]+=1 three=0 two=0 for c in cnt: if (c==2): two+=1 elif(c==3): three+=1 if (three==1 and two==1): print ('FULL HOUSE') elif (three==1): print ('THREE CARD') elif (two==2): print('TWO PAIR') elif (two==1): print('ONE PAIR') else: print('NO HAND')