=begin
1, 多重配列でA(i,j)の配列を作る
2, b = [m個]の配列を作る
3, A をindex付きで回し、a[i]とb[i]を掛けて ans に足していく
=end

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

A = []
n.times do
  num = gets.split.map(&:to_i)
  A << num
end

b = []
m.times do
  b << gets.to_i
end

A.each{|a|
  ans = 0
  a.each_with_index{|n, i|
    ans += a[i] * b[i]
  }
  puts ans
}
