import Control.Applicative

type Vector = [Int]

type Matrix = [Vector]

type Problem = (Matrix, Vector)

type Result = Vector

solve :: Problem -> Result

solve (matrix, vector)
    = [sum $ zipWith (*) row vector | row <- matrix]

input :: IO Problem

input
    = do
        [n, m] <- map read.words <$> getLine
        matrix <- inputMatrix n []
        vector <- inputVector m []
        return (matrix, vector)
        
inputMatrix :: Int -> Matrix -> IO Matrix

inputMatrix 0 matrix
    = return $ reverse matrix
    
inputMatrix n matrix
    = do
        row <- map read.words <$> getLine
        inputMatrix (n - 1) $ row : matrix
        
inputVector :: Int -> Vector -> IO Vector

inputVector 0 vector
    = return $ reverse vector
    
inputVector m vector
    = do
        row <- read <$> getLine
        inputVector (m - 1) $ row : vector
    
output :: Result -> String

output xs
    = concat [show x ++ "\n" | x <- xs]
    
main :: IO ()

main = putStr.output =<< solve <$> input