import collections v,c=zip(*(collections.Counter(list(input().split()))).most_common()) r="NO HAND" if c[0]==3: r="FULL HOUSE" if c[1]==2 else "THREE CARD" if c[0]==2: r="TWO PAIR" if c[1]==2 else "ONE PAIR" print(r)