s=sorted A=s(map(int,input().split())) R=s([A.count(x) for x in set(A)]) print(((((('NO HAND','ONE PAIR')[2 in R],'TWO PAIR')[R==[1,2,2]]),'THREE CARD')[3 in R],'FULL HOUSE')[R==[2,3]])