n, m = gets.split.map(&:to_i)
vec_a = []
vec_b = []

n.times do
  vec_a << gets.split.map(&:to_i)
end

m.times do
  vec_b << gets.to_i
end

vec_c = Array.new(n, 0)

n.times do |i|
  m.times do |j|
    vec_c[i] += vec_a[i][j] * vec_b[j]
  end
end

vec_c.each do |c|
  p c
end

