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