n, m = gets.split.map{|v|
      v.to_i
}
a = Array.new
b = Array.new

for i in 1..n
  a[i-1] = gets.split(" ").map(&:to_i)
end

for k in 1..m
  b[k-1] = gets.to_i
end

for i in 1..n
  c = 0
  for j in 1..m
    c += a[i-1][j-1] * b [j-1]
  end
  print c, "\n"
end
