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