#!/usr/bin/env ruby

temp = gets.split.map(&:to_i)
vectorA = Array.new(temp[0]*temp[1],0)
vectorB = Array.new(temp[1],0)
sum = 0
temp[0].times do |i|
    foo = gets.split.map(&:to_i)
    temp[1].times do |index|
        vectorA[i*temp[1] + index] = foo[index]
    end
end

temp[1].times do |index|
    vectorB[index] = gets.split.map(&:to_i)[0]
end

temp[0].times do |i|
    temp[1].times do |index|
        sum += vectorA[i*temp[1] + index] * vectorB[index]
    end
    puts sum
    sum = 0
end
