input = STDIN.gets.split(" ")
n = input[0].to_i
m = input[1].to_i
mat = Array.new(n) { Array.new(m) }
vec = Array.new(m)

for i in 1..n
  a = gets.split.map {|s| s.to_i}
  mat[i-1] = a
end

for i in 1..m  do
  j = gets.to_i
  vec[i-1] = j
end

for i in 1..n
  s = 0
  for j in 1..m
    s += mat[i-1][j-1] * vec[j-1]
  end
  puts s
end
