n,m = gets.chomp.split(" ").map { |e| e.to_i }

a = Array.new(n){Array.new(m,0)}
b = Array.new(m)
c = Array.new(n,0)

k = 0
while k <= n-1
a[k] = gets.chomp.split.map { |e| e.to_i }
k += 1
end
t = 0
while t <= m-1
b[t] = gets.to_i
t += 1
end

for i in 0..(n-1)
  for e in 0..(m-1)
    c[i] += a[i][e] * b[e]
  end
end
for i in 0..(n-1)
  puts c[i]
end