Rotate Image

MediumArrays
Next
MatrixArray

Rotate a square matrix 90 degrees clockwise.

Input

Line 1: n, the size of the n x n matrix. Next n lines: n integers each.

Output

Print the rotated matrix, one row per line.

Constraints

1 <= n <= 200 -10^9 <= each value <= 10^9

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

The first column read bottom to top (7 4 1) becomes the first row.

Hints

Rotate Image - Medium Arrays Problem | Skill Shiksha