LearnPy Hub
← Arena
IntermediateRating 1100

Rotate the Picture

Rotate an r×c grid of characters 90° clockwise and print it.

Input

r c, then r lines.

Output

c lines.

Sample 1

Input
2 3
abc
def
Output
da
eb
fc

Sample 2

Input
1 1
x
Output
x
solution.py
Output appears here
Rotate the Picture · Python Arena problem · LearnPy Hub