n,m = gets.split.map(&:to_i)
A = Array.new(n).map{Array.new(m)}
b = Array.new(m)
n.times do |i|
    A[i] = gets.split.map(&:to_i)
end
m.times do |i|
    b[i] = gets.to_i
end
n.times do |i|
    x = 0
    m.times do |j|
        x += A[i][j] * b[j]
    end
    puts x
end
