A = Array.new
b = Array.new
n, m = gets.split.map(&:to_i)
n.times do 
    A << gets.split.map(&:to_i)
end
m.times do
    b << gets.to_i
 end
 
A.each do |is|
  j = 0
  sum = 0
  is.each do |i|
    sum += i * b[j]
    j += 1
  end
  puts sum
end