#include <bits/stdc++.h>
using namespace std;
int ar[1000][1000];
void print(int n) {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cout << ar[i][j] << " ";
    }
    cout << "\n";
  }
  cout << "--------------\n";
}
int main() {
  int n;
  cin >> n;
  int centre = n / 2;
  ar[centre][centre] = 1;
  int i, j;
  int val = 0;
  int d = 1;
  for (i = 1; i < n; i += 2) {
    int z = (2 * i + 2);
    int val = d;
    for (j = centre; j < centre + val; j++) {
      ar[centre + d][j] = 1;
      ar[centre - d][j] = 1;
    }
    for (j = centre; j > centre - val; j--) {
      ar[centre + d][j] = 1;
      ar[centre - d][j] = 1;
    }
    ar[centre][centre + d] = 1;
    ar[centre][centre - d] = 1;
    d++;
  }
  int count1 = 1;
  int count2 = 2;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (ar[i][j] == 1) {
        ar[i][j] = count1;
        count1 += 2;
      } else {
        ar[i][j] = count2;
        count2 += 2;
      }
      cout << ar[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
