a = list(map(int,input().split())) b = [0]*13 for i in range(5): b[a[i]]+=1 c = [k for k in b if k !=0] c.sort(reverse=True) if c==[3,2]: print('FULL HOUSE') elif c==[3,1,1]: print('THREE CARD') elif c==[2,2,1]: print('TWO PAIR') elif c==[2,1,1,1]: print('ONE PAIR') else: print('NO HAND')