#C6008. Matrix Rotation

    ID: 49721 Type: Default 1000ms 256MiB

Matrix Rotation

Matrix Rotation

You are given an \( n \times n \) matrix of integers. Your task is to rotate the matrix by 90° clockwise. For a given matrix \( A \), the rotated matrix \( B \) is defined as:

\[ B_{i,j} = A_{n-1-j, i} \]

The input will be read from standard input and the rotated matrix should be printed to standard output with each row on a new line and numbers separated by a single space.

Example:

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

Output: 7 4 1 8 5 2 9 6 3

</p>

inputFormat

The first line of input contains an integer \( n \) representing the number of rows (and columns) of the square matrix. Each of the following \( n \) lines contains \( n \) space-separated integers representing the matrix rows.

outputFormat

Print the rotated matrix, with each row on a new line and values separated by a single space.

## sample
3
1 2 3
4 5 6
7 8 9
7 4 1

8 5 2 9 6 3

</p>