import Control.Applicative
import Data.Function
import Control.Monad

f :: [[Int]] -> [Int] -> [Int] 
f [] _ = []
f (x:xs) y = (sum $ zipWith (*) x y) : f xs y  

main :: IO ()
main = do
    [n,m] <- map read . words <$> getLine
    nxm <- replicateM n $ map read . words <$> getLine
    mx1 <- replicateM m $ read <$> getLine
    forM_ (f nxm mx1) $ \x -> putStrLn $ show x
