h=Hash.new 0 gets(p).downcase.tr('!-`','').gsub(/\w+/){h[$&]+=1} h.sort.map{|k,v|puts"#{v} "+k}