#include<stdio.h>
#define maxsize 100
int main() {
	int n,i,j,temp;
	scanf("%d", &n);
	int data[maxsize][maxsize];
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			scanf("%d", &data[i][j]);
		}
	}
	for (i = 0; i < n; i++) {
		for (j = i; j < n; j++) {
			temp = data[i][j];
			data[i][j] = data[j][i];
			data[j][i] = temp;
		}
	}
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			printf("%d ", data[i][j]);
		}
		printf("\n");
	}
	return 0;
}