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