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

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

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

m.times {
  b << 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