n, m = gets.split.map!(& :to_i)
a_array = Array.new(n).map{ Array.new(m,0) }
n.times do |i|
  inputs = gets.split.map!(& :to_i)
  inputs.each.with_index do |val, ind|
  	a_array[i][ind] = val
  end
end

b_array = Array.new(m)
m.times do |ind|
  b_array[ind] = gets.to_i
end

n.times do |i|
  result = 0
  m.times do |j|
  	result += a_array[i][j] * b_array[j]  	
  end
  puts result
end