#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> even, odd;
  for (auto i = 1; i <= (long long)(n * n); i++)
    if (i & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  int half = (n + 1) / 2, val = 1, o = n - 1;
  vector<int> x;
  for (auto i = 1; i <= (long long)(half); i++) {
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    for (auto j = 0; j < (long long)(val); j++)
      x.push_back(odd.back()), odd.pop_back();
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    val += 2, o -= 2;
  }
  val -= 2;
  o += 2;
  for (int i = half - 1; i >= 1; i--) {
    val -= 2, o += 2;
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    for (auto j = 0; j < (long long)(val); j++)
      x.push_back(odd.back()), odd.pop_back();
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
  }
  for (auto i = 0; i < (long long)(((int)((x).size()))); i++) {
    cout << x[i] << " ";
    if ((i + 1) % n == 0) cout << '\n';
  }
  return 0;
}
