import Control.Applicative
import Control.Monad

multiplyMatrix :: [[Int]] -> [Int] -> [Int]
multiplyMatrix a v = map (sum . zipWith (*) v) a

main = do
    [n, m] <- (map (read :: String -> Int) . words) <$> getLine
    a <- replicateM n ((map read . words) <$> getLine)
    v <- (map read . lines) <$> getContents
    putStr $ unlines $ map show $ multiplyMatrix a v