matrix_A = []
matrix_B = []
matrix_C = []

height, width = gets.split.map(&:to_i)
height.times{ matrix_A << gets.split.map(&:to_i) }
width .times{ matrix_B << gets.to_i }

height.times do|h|
  tempC = 0
  width.times do|w|
    tempC += matrix_A[h][w] * matrix_B[w]
  end
  matrix_C << tempC
end

puts matrix_C

