11352 - Matrix Multiplication   

Description

Compute C = A × B, where AB and C are matrices of size n × mm × p, and n × p, respectively.

Input

There are multiple (50) test cases in each data set.

Each case begins with a line of three integers nm and p, which denote the dimensions of the matrices defined in the problem description. Each of the following n lines contains m integers aij, representing the elements in matrix A, and then m lines of p integers bij, representing the elements in matrix B.

There is a blank line between two successive test cases, and the input is terminated by end-of-file.

 

For data set #1, 1 ≤ nmp ≤ 5 and |aij|, |bij| ≤ 1000.

For data set #2, 1 ≤ nmp ≤ 20 and |aij|, |bij| ≤ 1000.

For data set #3, 1 ≤ nmp ≤ 50 and |aij|, |bij| ≤ 1000.

For data set #4, 1 ≤ nmp ≤ 100 and |aij|, |bij| ≤ 10000.

Output

For each test case, output n lines of p integers representing the elements of matrix C.

Please use single space to separate two successive elements in the same line, and do not output any leading or trailing space characters.

Also, please output a blank line after each matrix.

Sample Input  Download

Sample Output  Download

Tags




Discuss