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