An $n \times m$ matrix is given. Print its transpose (an $m \times n$ matrix), rows on separate lines, values space-separated.
Input
Line 1: $n$ $m$. Next $n$ lines: the matrix ($1 \le n, m \le 10$).
Output
Print the transposed matrix.
Example 1
Input
2 3 1 2 3 4 5 6
Output
1 4 2 5 3 6
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.