#include <iostream>
#include <cassert>

using namespace std;

#define PROBLEM "F"

#define MAXN 200

int a[MAXN][MAXN];

int main() {
	freopen(PROBLEM ".in", "r", stdin);
	freopen(PROBLEM ".out", "w", stdout);
	int n;
	cin >> n;
	assert(n&1);

	for (int i = 0; i <= n + 1; i++) {
		for (int j = 0; j <= n + 1; j++) {
			if (!i || !j || i == n + 1 || j == n + 1) {
				a[i][j] = 1;
			}
		}
	}

	int x, y, xx, yy;

  	x = n, y = n + 1, xx = 0, yy = -1;

   int k = n * n;
   while (k > 0) {
   	if (a[x + xx][y + yy] != 0) {
   		if (xx == 1) {
   			xx = 0, yy = 1;
   		} else if (xx == -1) {
   			xx = 0, yy = -1;
   		} else if (yy == 1) {
   			xx = -1, yy = 0;
   		} else if (yy == -1) {
   			xx = 1, yy = 0;
   		}
   	} else {
   		x += xx, y += yy;
   		a[x][y] = k--;
   	}
   }

   for (int i = 1; i <= n; i++) {
   	for (int j = 1; j <= n; j++) {
   		cout << a[i][j] << " ";
   	}
   	cout << endl;
   }

	return 0;
}
