#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
vector<long long> v;
int n;
int matrix[51][51];
int main() {
  scanf("%d", &n);
  int sqrt = n * n;
  int i = 0;
  int j = n >> 1;
  for (int k = 1; k <= sqrt; ++k) {
    matrix[i][j] = k;
    i--;
    j++;
    if (k % n == 0) {
      i++;
      i++;
      --j;
    } else {
      if (j == n)
        j -= n;
      else {
        if (0 > i) i += n;
      }
    }
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += matrix[i][0];
    for (int j = 0; j < n; j++) {
      printf("%d ", matrix[i][j]);
    }
    printf("\n");
  }
}
