n, m = gets.chomp.split(" ").map(&:to_i)
matrix = []
n.times do |i|
  matrix[i] = gets.chomp.split(" ").map(&:to_i)
end

vector = []
m.times do |i|
  vector[i] = gets.to_i
end

matrix.each do |i|
  sum = 0
  m.times do |j|
    sum += i[j] * vector[j]
  end
  puts sum
end