import Data.Functor( (<$>))
import Control.Monad( replicateM)

main = do
    let
	readLine = (read <$>) . words <$> getLine

    [n,m] <- readLine
    matrixData <- replicateM n readLine
    b <- concat <$> replicateM m readLine
    let
	rowXcolumn r = sum $ zipWith (*) r b
	answer = rowXcolumn <$> matrixData

    print `mapM_` answer

