#include <iostream>
using namespace std;

const int MAX_SIZE = 10;

int main() {
	int n, mt[MAX_SIZE + 1][MAX_SIZE + 1];
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			cin >> mt[i][j];
		}
	}
	++n;
	
	for (int i = n; i > 1; --i) {
		for (int j = 1; j < n; ++j) {
			if (i > n /2 + 1) {
				mt[i][j] = mt[i - 1][j];
			}
			if (i == n / 2 ) {
				mt[i][j] = mt[j][n - 1];
			} 
		}
		
	}
	
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j < n; ++j) {
			cout << mt[i][j] <<" ";
		}
		cout <<"\n";
	}


	
	return 0;
}