#C3045. Matrix Transposition

    ID: 46429 Type: Default 1000ms 256MiB

Matrix Transposition

Matrix Transposition

You are given an n x n matrix. Your task is to compute its transpose. The transpose of a matrix \(A\) is another matrix \(A^T\) such that the element at row \(i\) and column \(j\) in \(A\) becomes the element at row \(j\) and column \(i\) in \(A^T\).

Input: The first line contains an integer \(n\) representing the dimension of the square matrix. The following \(n\) lines each contain \(n\) space-separated integers representing the rows of the matrix.

Output: Output the transposed matrix, where each row is printed on a new line and the elements in each row are space-separated.

inputFormat

The first line of input contains a single integer \(n\) (\(1 \leq n \leq 100\)) indicating the size of the matrix. The next \(n\) lines each contain \(n\) integers separated by spaces, representing the matrix rows.

outputFormat

Output the transposed matrix, with each of its \(n\) rows printed on a new line. Each row should contain \(n\) integers separated by a single space.

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

2 5 8 3 6 9

</p>