
n, m = gets.split(" ").map(&:to_i)
arr1 = []; arr2 = []

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

m.times { arr2 << gets.to_i }

ans = []

arr1.each do |arr|
  int = 0
  arr.each_with_index do |val, ind|
    int += val * arr2[ind]
  end
  ans << int
end

puts ans