$_=gets.split.map(&:to_i).group_by{|i|i}.map{|i,j|j.size}.sort*'' puts /23/?'FULL HOUSE':/3/?'THREE CARD':/22/?'TWO PAIR':/2/?'ONE PAIR':'NO HAND'