a=map(int,raw_input().split()) b=sorted(a.count(i)for i in range(1,14))[:-3:-1] print[["NO HAND",["ONE PAIR","TWO PAIR"][b[1]==2]][b[0]==2],["THREE CARD","FULL HOUSE"][b[1]==2]][b[0]==3]