def show_result(arr1, arr2)
  result = 0
  arr1.size.times { |i| result += arr1[i] * arr2[i] }
  puts result
end

row = []
input = gets.chomp.split(' ').map(&:to_i)
input[0].times { |n| row.push(gets.chomp.split(' ').map(&:to_i)) }

column = []
input[1].times { column.push(gets.chomp.to_i) }

row.size.times { |i| show_result(row[i], column) }