#include <bits/stdc++.h>
using namespace std;
int odd[2000], even[2000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i += 2) {
    odd[(i - 1) / 2] = i;
  }
  for (int i = 2; i <= n * n; i += 2) {
    even[i / 2 - 1] = i;
  }
  int i = 0, k = 0;
  if (n == 3) {
    cout << "2 1 4\n";
    cout << "3 5 7\n";
    cout << "6 9 8\n";
    return 0;
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < n; y++) {
      if ((n - 1) % 4 == 0) {
        if (x == y) {
          cout << odd[i++] << " ";
          continue;
        }
        if ((x < n / 2 && y > n / 2) || (x > n / 2 && y < n / 2)) {
          cout << odd[i++] << " ";
          continue;
        }
      } else {
        if (y < n / 2) {
          cout << odd[i++] << " ";
          continue;
        }
        if ((x == 0 && y < n - 2) || (x == 2 && y >= n - 2)) {
          cout << odd[i++] << " ";
          continue;
        }
      }
      cout << even[k++] << " ";
    }
    cout << "\n";
  }
  return 0;
}
