#include <bits/stdc++.h>
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const int maxn = 55;
int res[maxn][maxn];
int n;
int main() {
  read(n);
  int now = 1;
  int mid = n / 2 + 1;
  for (int i = 1; i <= n / 2 + 1; i++) {
    for (int j = mid - i + 1; j <= mid + i - 1; j++) {
      res[i][j] = now;
      now += 2;
    }
  }
  int len = n / 2;
  for (int i = n / 2 + 2; i <= n; i++) {
    for (int j = mid - len + 1; j <= mid + len - 1; j++) {
      res[i][j] = now;
      now += 2;
    }
    len--;
  }
  now = 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!res[i][j]) {
        res[i][j] = now;
        now += 2;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", res[i][j]);
    }
    puts("");
  }
  return 0;
}
