#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    int n, i, j, k, r;
    cin >> n;
    for (i = 0; i < n; i++) {
      for (j = 0; j < 2 * (n - i) - 1; j++) cout << " ";
      for (k = 0; k < (2 * i + 1) / 2 + 1; k++) cout << " " << k;
      for (r = (2 * i + 1) / 2; r > 0; r--) cout << " " << r - 1;
      cout << "\n";
    }
    for (i = 0; i < n; i++) cout << i << " ";
    for (j = n; j > -1; j--) {
      if (j == n)
        cout << j;
      else
        cout << " " << j;
    }
    cout << "\n";
    for (i = 0; i < n; i++) {
      for (j = 0; j < 2 * i + 1; j++) cout << " ";
      for (j = 0; j < n - i - 1; j++) cout << " " << j;
      for (j = n - i - 1; j > -1; j--) cout << " " << j;
      cout << "\n";
    }
  }
  return 0;
}
