nm = gets.split(" ").map(&:to_i)

mat = Array.new
i = 0
nm[0].times do
  mat[i] = gets.split(" ").map(&:to_i)
  i += 1
end

v = Array.new
i = 0
nm[1].times do
  v[i] = gets.to_i
  i += 1
end

for i in 0..nm[0]-1 do
  sum = 0
  for j in 0..nm[1]-1 do
    sum += mat[i][j] * v[j]
  end
  printf "%d\n", sum
end