n,m = gets.chomp.split.map(&:to_i)
# p gets.split.map(&:to_i)
a = []
b = []
for i in 0..n-1 do
    s = gets
    a.push(s.split.map(&:to_i))
end
while s = gets
    b.push(s.chomp.to_i)
end

for i in 0..n-1 do
    ans = 0
    for j in 0..m-1 do
        ans += a[i][j] * b[j]
    end
    puts ans
end



