Skip to content
UPEEC

Transpose a Matrix

Easy#arrays#matrix· solved by 0 · time limit 2.0 s

Print the transpose of an R×CR \times C matrix (rows become columns).

Input

RR and CC, then RR rows of CC integers.

Output

CC rows of RR integers.

Constraints

1≤R,C≤1001 \le R, C \le 100

Sample 1

Input

2 3
1 2 3
4 5 6

Output

1 4
2 5
3 6

Sign in or join free to run and submit your solution.