import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nml = readints;
    int n = nml[0], m = nml[1], l = nml[2];

    auto a = new int[][](n, m);
    auto b = new int[][](m, l);
    for (int i = 0; i < n; i++) {
        a[i][] = readints;
    }
    for (int i = 0; i < m; i++) {
        b[i][] = readints;
    }

    auto mat = new Mat!int(a) * new Mat!int(b);
    mat.dump();
}


class Mat(T) {
    private const T[][] _mat;

    @property int rows() const { return cast(int)_mat.length; }
    @property int cols() const { return cast(int)_mat[0].length; }

    this(const T[][] init) {
        assert(init.length > 0 && init[0].length > 0);

        _mat = init.dup;
    }

    T get(int r, int c) const {
        return _mat[r][c];
    }

    Mat opMul(Mat m) {
        return mul(m, int.max);
    }

    Mat mul(const Mat m, int mod) const {

        Mat multiple(const T[][] a, const T[][] b) {
            auto arows = a.length;
            auto acols = a[0].length;
            auto brows = b.length;
            auto bcols = b[0].length;

            auto t = new T[][](arows, bcols);
            for (int i = 0; i < arows; i++) {
                for (int j = 0; j < bcols; j++) {
                    int x = 0;
                    for (int k = 0; k < acols; k++) {
                        x = (x + (a[i][k] * b[k][j]) % mod) % mod;
                    }
                    t[i][j] = x;
                }
            }
            return new Mat(t);
        }

        return multiple(_mat, m._mat);
    }

    Mat copy() const {
        return new Mat(_mat);
    }

    Mat pow(int k, int mod) const {
        assert(k > 0);
        if (k == 1) return this.copy();

        auto m = this.pow(k / 2, mod);
        return k % 2 == 0
            ? m.mul(m, mod)
            : this.mul(m.mul(m, mod), mod);
    }

    void dump() const {
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                if (j > 0) write(" ");
                write(_mat[i][j]);
            }
            writeln();
        }
    }
}

