#C4342. 90 Degree Clockwise Grid Rotation
90 Degree Clockwise Grid Rotation
90 Degree Clockwise Grid Rotation
You are given an n x n grid consisting of lowercase alphabets. Your task is to transform the grid by rotating it 90 degrees clockwise.
In other words, if the original grid is represented by \(G\) where \(G[i][j]\) denotes the character in the \(i^{th}\) row and \(j^{th}\) column (0-indexed), then the transformed grid \(R\) is given by:
\( R[i][j] = G[n-1-j][i] \)
For example, if \(n=3\) and the grid is:
abc def ghi
The rotated grid is:
gda heb ifc
inputFormat
The first line contains a positive integer \(n\) representing the size of the grid.
Each of the following \(n\) lines contains a string of length \(n\) representing a row of the grid.
outputFormat
Output the transformed grid of size \(n \times n\) after rotating it 90 degrees clockwise. Print each row of the resulting grid on a new line.
## sample3
abc
def
ghi
gda
heb
ifc
</p>