def q d d.chomp.split"" end s=q(gets).map{|i|i[0]} v=[] while gets v<