import Control.Applicative

type Row = [Int]

type Rows = [Row]

type Matrix = (Int, Int, Rows)

type Problem = (Matrix, Matrix)

type Result = Rows

access :: Rows -> Int -> Int -> Int

access rows row col
    = rows !! row !! col
    
calcElement :: Matrix -> Matrix -> Int -> Int -> Int

calcElement (_, m, rows1) (_, _, rows2) row col
    = sum [access rows1 row x * access rows2 x col | x <- ms] where
        ms = [0..(m - 1)]

solve :: Problem -> Result

solve (mat1@(n, _, _), mat2@(_, l, _))
    = [[calcElement mat1 mat2 row col | col <- ls] | row <- ns] where
        ns = [0..(n - 1)]
        ls = [0..(l - 1)]

output :: Result -> String

output rows
    = init.concat $ [outputRow row ++ "\n" | row <- rows]
    
outputRow :: Row -> String

outputRow row
    = init.concat $ [show x ++ " " | x <- row]
    
input :: IO Problem

input
    = do
        [n, m, l] <- map read.words <$> getLine
        rows1 <- inputRows n []
        rows2 <- inputRows m []
        return ((n, m, rows1), (m, l, rows2))
        
inputRows :: Int -> Rows -> IO Rows

inputRows 0 rows
    = return rows
    
inputRows n rows
    = do
        row <- map read.words <$> getLine
        inputRows (n - 1) $ rows ++ [row]
    
main :: IO ()

main
    = putStrLn.output =<< solve <$> input