LearnPy Hub
← Comprehensions problems
Medium

Transpose

Read r and c, then r lines of c integers. Print the transposed grid (rows become columns), one row per line.

Input

r c, then r lines.

Output

c lines.

Sample 1

Input
2 3
1 2 3
4 5 6
Output
1 4
2 5
3 6

Sample 2

Input
1 1
9
Output
9
solution.py
Output appears here
Transpose · Python practice problem · LearnPy Hub