# frozen_string_literal: true

require 'matrix'

n, m = readline.split(' ').map(&:to_i)
a = []
n.times do
  a << readline.split(' ').map(&:to_i)
end
a = Matrix.rows(a, true)
v = []
m.times do
  v << readline.chomp!.to_i
end
v = Vector.elements(v, true)
c = a * v
puts c.to_a.join("\n")

