require 'matrix'

n, m = gets.split.map(&:to_i)
arr, ary = [], []

n.times{ arr << gets.split.map(&:to_i) }
m.times{ ary << gets.to_i}

ma = Matrix[*arr]
mb = Matrix.column_vector(ary)
mc = ma * mb

mc.each do |c|
  puts c
end