n, m = gets.split(" ").map(&:to_i)
matrix = []
n.times do
  matrix << gets.split(" ").map(&:to_i)
end
vector = []
m.times do
  vector << gets.to_i
end
result = []
n.times do |i|
  item = matrix[i]
  temp = 0
  m.times do |j|
    temp += item[j] * vector[j]
  end
  result << temp
end
puts result