n, m = gets.split( " " ).map { | val | val.to_i }
ai = Array.new( n )
ai.each_index { |i|
	ai[i] = gets.split( " " ).map { | val | val.to_i }
}
bi = Array.new( m )
bi.each_index { |i|
	bi[i] = gets.chomp!.to_i
}

ci = Array.new( n, 0 )
ai.each_index { |i|
	ai[i].each_index { |j|
		ci[i] += ( ai[i][j] * bi[j] )
	}
	puts( ci[i] )
}