process.stdin.on('data', function (chunk) {
	var line, nml, a, b, ci;
	line = chunk.toString().split(/\r?\n/);
	nml = line.shift().split(' ').map(Number);
	a = line.slice(0, nml[0]).map(decodeLine);
	b = line.slice(nml[0], nml[0]+nml[1]).map(decodeLine);
	ci = new Array(nml[2]);
	c = a.map(function(ai) {
		const m = nml[1], prod = product;
		var j;
		for (j = nml[2] - 1; j >= 0; j--) {
			ci[j] = prod(j, m, ai, b);
		}
		return ci.join(' ');
	});

	console.log(c.join('\n'));
});

function decodeLine(line) {
	return line.split(' ').map(Number);
}

function product(j, m, ai, b) {
	var k, res = 0;
	for (k = m - 1; k >= 0; k--) res += ai[k] * b[k][j];
	return res;
}