n, m = gets.split(" ").map(&:to_i)
matrix = Array.new(n).map{ Array.new(m) }
vector = Array.new(m)
c = Array.new(n, 0)

for i in 0..(n - 1)
  matrix[i] = gets.split(" ").map(&:to_i)
end

for j in 0..(m - 1)
  vector[j] = gets.to_i
end

for i in 0..(n - 1)
  for j in 0..(m - 1)
    c[i] += matrix[i][j] * vector[j]
  end
end

for i in 0..(n - 1)
  puts c[i]
end