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

printInts :: [Int] -> IO ()
printInts = putStrLn . intercalate " " . fmap show

mult :: [[Int]] -> [[Int]] -> [[Int]]
mult xss yss = [[sum (zipWith (*) xs ys) | ys <- yss'] | xs <- xss]
  where
    yss' = transpose yss

main :: IO ()
main = do
    [n, m, _] <- fmap read . words <$> getLine :: IO [Int]
    xss <- fmap (fmap read . words) . lines <$> getContents :: IO [[Int]]
    let (mat1, xss') = splitAt n xss
    let mat2 = take m xss'
    let answer = mult mat1 mat2
    mapM_ printInts answer

