#include <bits/stdc++.h>
using namespace std;
vector<int> seat;
int main() {
  int N;
  cin >> N;
  int MN = N * N;
  seat = vector<int>(MN);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      seat.at(i * N + j) = min(min(i, N - i - 1), min(j, N - j - 1));
      cout << seat.at(i * N + j) << " ";
    }
    cout << endl;
  }
}
