Suki's Garden Rotation
Suki has a special garden laid out in an n×n grid. Each cell contains a flower with a particular bloom pattern. One morning, Suki's owner decides to rotate the entire garden 90° clockwise to catch more of the afternoon sun. The flowers must be rearranged so that the leftmost column becomes the top row, the bottom row becomes the leftmost column, and so on.
Given the original garden layout as an n×n grid, output the rotated layout after a 90° clockwise rotation.
Input
The first line contains n (1 ≤ n ≤ 500), the size of the garden grid.
The next n lines each contain n integers a_{i,j} (0 ≤ a_{i,j} ≤ 10^9), representing the bloom pattern ID at position (i, j) in the original garden.
Output
Print n lines, each containing n space-separated integers. The output should represent the rotated garden.
Notes
For a 90° clockwise rotation, the element at position (i, j) in the original grid should move to position (j, n−1−i) in the rotated grid. Equivalently, the top-left to bottom-right diagonal becomes the top-left to top-right row, the left column becomes the top row, and the top row becomes the right column.