LearnPy Hub
← Arena
IntermediateRating 1400

Anti-Diagonals

Print the elements anti-diagonal by anti-diagonal (cells with equal row + column), each diagonal from top-right to bottom-left, on one line.

Input

r c, then r lines.

Output

One line.

Sample 1

Input
3 3
1 2 3
4 5 6
7 8 9
Output
1 2 4 3 5 7 6 8 9

Sample 2

Input
1 3
1 2 3
Output
1 2 3
solution.py
Output appears here
Anti-Diagonals · Python Arena problem · LearnPy Hub