n,m=gets.split.map(&:to_i)
a=Array.new
n.times do
    a.push(gets.split.map(&:to_i))
end
b=Array.new
m.times do
    b.push(gets.to_i)
end
for i in 0...n
    c=0
    for j in 0...m
        c+=a[i][j]*b[j]
    end
    p c
end
