#include <bits/stdc++.h>
using namespace std;
long long dp[50][50];
int main() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  long long e = 2, o = 1;
  long long t = 0;
  long long mid = n / 2;
  long long cnt = 1;
  memset(dp, 0, sizeof dp);
  for (long long i = 0; i <= n / 2; i++) {
    long long c = cnt;
    for (long long j = mid - t; j < n && c--; j++) {
      dp[i][j] = o;
      o += 2;
    }
    cnt += 2;
    t++;
  }
  t -= 2;
  cnt -= 4;
  for (long long i = n / 2 + 1; i < n; i++) {
    long long c = cnt;
    for (long long j = mid - t; j < n && c--; j++) {
      dp[i][j] = o;
      o += 2;
    }
    cnt -= 2;
    t--;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (dp[i][j])
        cout << dp[i][j] << " ";
      else
        cout << e << " ", e += 2;
    }
    cout << endl;
  }
  return 0;
}
