#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      int temp =
          1 + ((i - j + (n - 1) / 2) % n) * n + ((i + j + (n + 1) / 2) % n);
      if (temp <= 0) {
        temp += n * n;
      }
      cout << temp << " ";
    }
    cout << endl;
  }
}
