n, m = gets.split(" ").map(&:to_i)

a = Array.new()
b = Array.new()

n.times {
  a.puth(gets.split(" ").map(&:to_i))
}

m.times {
  b.puth(gets.to_i)
}

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