MODE = "stdio"
require 'matrix'
line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = "\
  3 4
  1 2 0 1
  0 3 0 1
  4 1 1 0
  1
  2
  3
  0
  ".split("\n")
  tmp.each{|s|
    line << s.strip
  }
end
m,n =  line[0].split(" ").map(&:to_i)

mat = Array.new
vec = Array.new

(1..m).each do |mm|
  mat<<line[mm].split(" ").map(&:to_i)
end

(1+m..m+n).each do |nn|
  vec<<line[nn].to_i
end

A = Matrix[*mat]
B = Vector[*vec]

puts (A*B).to_a