10759 - 2015-I2P(I)-hw4_2   

Description

Given two N x N matrices, you are asked to compute a new N x N matrix each of whose elements is set as the smaller one of the two corresponding elements at the same position in the two given matrices.

For example, for the following two given matrices A and B,

the asked new matrix is:

Input

The first line has N (3<=N<=9), which means the size of the two matrices. The total number of elements in each of the matrices is thus N x N.

For the next 2N lines, each contains N integers, specifying the elements of the two matrices. All of the integers in the same line are separated by a space.

Output

Print out all elements of the new matrix row-by-row.

All of the integers in the same line are separated by a space, and there is a '\n' at the end of each line.

Sample Input  Download

Sample Output  Download

Tags

10401HW4



Discuss