import Control.Applicative
import Control.Monad

dot [x] [y] = x * y
dot (x:xs) (y:ys) = x * y + dot xs ys

main = do
    n:m:_ <- map read.words <$> getLine ::IO[Int]
    a <- replicateM n ( map read.words <$> getLine ) ::IO [[Int]]
    b <- replicateM m ( read <$> getLine ) ::IO[Int]
    putStr $ concat (map ((++"\n").show) [ ai `dot` b | ai <- a ])