import Control.Monad

mulList :: [Int] -> [Int] -> Int
mulList [] _ = 0
mulList _ [] = 0
mulList (x:xs) (y:ys) = x * y + mulList xs ys

solv :: [[Int]] -> [Int] -> [Int]
solv [] _ = []
solv _ [] = []
solv (af:as) b = mulList af b : solv as b

main = do
    l <- getLine
    let (m:n:_) = map read . words $ l
    la <- replicateM m getLine
    lb <- replicateM n getLine
    let a = map (map read . words) $ la
    let b = map read lb
    mapM_ (putStrLn . show) $ solv a b