x = gets.split(" ").map(&:to_i)
n = x[0]
m = x[1]
a = []
for i in 0..n-1 do
  a << gets.split(" ").map(&:to_i)
end

b = []
for i in 0..m-1 do
  b << gets.to_i
end

for i in 0..n-1 do
  v = 0
  for j in 0..m-1 do
    v += a[i][j] * b[j]
  end
  puts v
end
