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

i = 0
a = Array.new
while true do
   if i == n
      break
   end
   a << gets.split.map(&:to_i)
   i += 1
end

i = 0
b = Array.new
while true do
   if i == m
      break
   end
   b << gets.chomp.to_i
   i += 1
end

sums = []
a.each_with_index do |nums, idx_1|
   sum = 0
   nums.each_with_index do |num, idx_2|
      sum += num * b[idx_2]
   end
   sums[idx_1] = sum
end

sums.each do |val|
   puts val
end