n, m = gets.split.map(&:to_i)

ary_A = []
ary_B = []

n.times do
    ary_A.push(gets.split.map(&:to_i))
end

m.times do
    ary_B.push(gets.to_i)
end

n.times do |i|
    num = 0
    for j in 0..m-1 do
        num += ary_A[i][j] * ary_B[j]
    end
    puts num
end
