require 'matrix'
n, m = gets.split.map(&:to_i)

a =
n.times.inject([]) do |m, o|
  m << gets.split.map(&:to_i)
end

b =
m.times.inject([]) do |m, o|
  m << gets.to_i
end

ma = Matrix[*a]
mb = Matrix.column_vector(b)

mc = ma * mb

mc.each do |e|
  puts e
end