n, m = gets.split.map(&:to_i)
A = Array.new(n)
B = Array.new(m)
result = Array.new(n, 0)
n.times do |i|
  A[i] = gets.split.map(&:to_i)
end

m.times do |i|
  B[i] = gets.to_i
end

n.times do |i|
  m.times do |j|
    result[i] += A[i][j] * B[j]
  end
end
puts result
