require "matrix"

a, b = gets.split.map(&:to_i)
ary1 = []
ary2 = []
a.times{ ary1 << gets.split.map(&:to_i)}
b.times{ ary2 << gets.chomp.to_i}
m = Matrix[ary1]
mb = Matrix.column_vector(ary2)
puts m * mb