#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int ans[60][60];
    memset(ans, 0, sizeof(ans));
    ans[1][n / 2 + 1] = 1;
    int x = 1, y = n / 2 + 1;
    int cou = 1;
    while (cou != n * n) {
      int a = x - 1, b = y + 1;
      if (a == 0) {
        a = n;
      }
      if (b > n) {
        b = 1;
      }
      if (ans[a][b] == 0) {
        ans[a][b] = ++cou;
        x = a;
        y = b;
      } else {
        a = x + 1;
        b = y;
        if (a > n) {
          a = 1;
        }
        ans[a][b] = ++cou;
        x = a;
        y = b;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (j != n) {
          printf("%d ", ans[i][j]);
        } else {
          printf("%d\n", ans[i][j]);
        }
      }
    }
  }
}
