# coding: utf-8 ##yuki_227 st=[] st=map(int,raw_input().split()) lt=list(st) l=lt[:5] b=[] for i in xrange(1,len(l)+1): b.append(l.count(i)) c=b.count(2) d=b.count(3) if c==1 and d==0: print "ONE PAIR" elif c==2 and d==0: print "TWO PAIR" elif d==1 and c==0: print "THREE CARD" elif c==1 and d==1: print "FULL HOUSE" else: print "NO HAND"