require "matrix"
a, b = gets.split.map(&:to_i)
ary1, ary2 = [], []
a.times{ary1<<gets.split.map(&:to_i)}
b.times{ary2<<gets.to_i}
m = Matrix[*ary1]
mb = Matrix.column_vector(ary2)
(m * mb).each{|z| puts z}