~/algor $ cat problems/matritsa-transponirlash
Transpose a matrix
Easy
1000 ms
128 MB
31%
A matrix of size $n \times m$ is given. Find and print its transpose $A^{T}$ (a matrix of size $m \times n$).
Input
The first line contains two positive integers $n$ and $m$. Each of the next $n$ lines contains $m$ integers.
Output
$m$ lines with $n$ space-separated integers each.
Note
$1 \le n, m \le 200$
$-1000 \le a_{i,j} \le 1000$
Examples
Input #1
2 3 1 2 3 4 5 6
Output #1
1 4 2 5 3 6
Input #2
1 1 9
Output #2
9