#B2106. Matrix Transposition

    ID: 11188 Type: Default 1000ms 256MiB

Matrix Transposition

Matrix Transposition

Given an n×mn \times m matrix (A), compute its transpose (A^T).

The transpose is obtained by swapping the rows and columns. That is, the element at position (a_{ij}) in (A) becomes the element at position (a_{ji}) in (A^T).

inputFormat

The first line contains two integers (n) and (m) representing the number of rows and columns respectively. Each of the next (n) lines contains (m) space-separated integers.

outputFormat

Output the transpose of the given matrix. Each row of the transposed matrix should be printed on a new line with its elements separated by a space.

sample

2 2
1 2
3 4
1 3

2 4

</p>