You are given a grid of integers with r rows and c columns. Visit every cell in a clockwise inward spiral that starts at the top-left corner: walk right across the top row, then down the right column, then left across the bottom row, then up the left column, then spiral inward and repeat until every cell has been visited exactly once.
Print the values in the order they are visited.
Input format
Line 1: two integers r and c separated by a space.
Next r lines: each contains c space-separated integers, giving the grid row by row.
Output format
A single line with all r·c values in spiral-visit order, separated by single spaces.
Constraints
- 1 ≤ r ≤ 200
- 1 ≤ c ≤ 200
- -1000000 ≤ each grid value ≤ 1000000