a=gets.split.map &:to_i b=(a|[]).map{|e|a.count e}.sort puts b[-1]==3?b[-2]==2?'FULL HOUSE':'THREE CARD':b[-2]==2?'TWO PAIR':b[-1]==2?'ONE PAIR':'NO HAND'