n, m = gets.split(" ").map{|ch| ch.to_i}
A = Array.new(n){gets.split(" ").map{|aij| aij.to_i}}
b = Array.new(m){gets.to_i}

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