a = []
b = []
n,m = gets.chomp.split(" ").map{|x| x.to_i}
for i in 1..n do
  a[i-1] = gets.chomp.split(" ").map{|x| x.to_i}
end
for j in 1..m do
  b[j-1] = gets.chomp.to_i
end

for i in 1..n do
  c = 0
  for j in 1..m do
    c += a[i-1][j-1] * b[j-1]
  end
  printf("%d\n",c)
end
