#include <iostream>

using namespace std;

const int MAXN = 100 + 10;
int matrix[MAXN][MAXN]; 

int main () {
	int n;
	while (cin >> n){
		for (int i = 0; i < n; i++){
			for (int j = 0; j < n; j++){
				cin >> matrix[i][j];
			}
		}
		int temp;
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				swap(matrix[i][j], matrix[j][i]);
			}
		}
		for (int i = 0; i < n; i++){
			for (int j = 0; j < n; j++){
				cout << matrix[i][j] << " ";
			}
			cout << endl;
		}
	}
	return 0;
}