n,m = gets.split.map(|n|:to_i)
mat = Array.new(n).map{Array.new(m)}
vec = Array.new(m)
for i in 1..n
  a = gets.split.map {|s|:to_i}
  mat[i-1] = a
end
for i in 1..m
  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