#include <bits/stdc++.h>
using namespace std;
int long long n, i, dp[55][55], j, k, h, j2;
bool used[3000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  k = 1;
  j2 = n / 2 + 1;
  for (i = 1; i <= n; i++) dp[j2][i] = k, k += 2;
  for (i = 1; i <= n / 2; i++) {
    for (j = j2 - i + 1; j <= j2 + i - 1; j++) {
      dp[i][j] = k;
      dp[n - i + 1][j] = k + 2;
      k += 4;
    }
  }
  k = 2;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (dp[i][j] == 0) dp[i][j] = k, k += 2;
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
}
