#105Easy
Transpose
Time: 1 s · Memory: 256 MB
- Matrices
Statement
You are given an matrix. Transpose it: rows become columns and columns become rows. The result is an matrix whose row , element equals .
Input format
The first line contains and (). Each of the next lines contains integers ().
Output format
lines with numbers each — the transposed matrix.
Examples
Input
2 3 1 2 3 4 5 6
Output
1 4 2 5 3 6
Input
2 1 7 8
Output
7 8
Note
In the first example the matrix 1 2 3 / 4 5 6 becomes 1 4 / 2 5 / 3 6. The size changes too: from to .
