import Control.Applicative
import Control.Monad

solve :: [[Int]] -> [Int] -> [Int]
solve matrix vector = map (\r -> foldl (+) 0 $ map (\(x, y) -> x * y) $ zip r vector) matrix

main :: IO ()
main = do
    [n, m] <- map read . words <$> getLine
    matrix <- map (map read . words) <$> replicateM n getLine
    vector <- map read <$> replicateM m getLine
    putStr $ unlines $ map show $ solve matrix vector