#C4182. Matrix Transposition

    ID: 47692 Type: Default 1000ms 256MiB

Matrix Transposition

Matrix Transposition

You are given a matrix of size M x N. Your task is to compute its transpose.

The transpose of a matrix \(A\) is defined as the matrix \(B\) such that:

\(B_{ij} = A_{ji}\)

Note: Input will be read from standard input (stdin) and output should be printed to standard output (stdout).

inputFormat

The first line of input contains two integers M and N separated by a space, representing the number of rows and columns of the matrix, respectively.

This is followed by M lines, each containing N integers separated by spaces, representing the rows of the matrix.

outputFormat

Output the transposed matrix in N lines. Each line should contain M space-separated integers representing a row of the transposed matrix.

## sample
3 3
1 2 3
4 5 6
7 8 9
1 4 7

2 5 8 3 6 9

</p>