#!/usr/bin/env ruby

temp = [];matrixA = [];matrixB = []
lineresult = []

temp = gets.split.map(&:to_i)
Array_A_WIDTH = temp[0]
Arrays_HEIGHT = temp[1]
Array_B_WIDTH = temp[2]

Array_A_WIDTH.times do
    matrixA << gets.split.map(&:to_i)
end
Arrays_HEIGHT.times do
    matrixB << gets.split.map(&:to_i)
end

Array_A_WIDTH.times do |loopA|
    Array_B_WIDTH.times do |loopC|
        foo = 0
        Arrays_HEIGHT.times do |loopB|
            foo += matrixA[loopA][loopB] * matrixB[loopB][loopC]
        end
        lineresult << foo
    end
    puts lineresult.join(' ')
    lineresult.clear
end
