import Control.Applicative
import Control.Monad
import Data.List

solve :: [[Int]] -> [String]
solve ([n,m,l]:matxs) =
    let (matA,matB) = splitAt n $ matxs in
    let mAB = [[sum $ zipWith (*) a b | b<-transpose matB] | a<-matA] in
    map (unwords . map show) mAB

main =
    mapM_ putStrLn =<< solve . takeInputs . lines <$> getContents
    where
    takeInputs :: [String] -> [[Int]]
    takeInputs = map (map read . words)
