#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 2 * n + 1;
  int **pat;
  pat = new int *[s];
  for (int i = 0; i < s; i++) {
    pat[i] = new int[s];
  }
  int m = s / 2;
  int cs[s];
  for (int i = 0; i < s; i++) {
    int f;
    if (i <= n)
      f = n - i;
    else
      f = i - n;
    cs[i] = f;
  }
  for (int i = 0; i < s; i++) {
    int sc = cs[i];
    int j = 0;
    for (; j < sc; j++) pat[i][j] = -1;
    int cv = 0;
    for (; j <= m; j++) {
      pat[i][j] = cv;
      cv++;
    }
    j = s - 1;
    for (; s - j <= sc; j--) pat[i][j] = -1;
    cv = 0;
    for (; s - j <= m; j--) {
      pat[i][j] = cv;
      cv++;
    }
  }
  for (int i = 0; i < s; i++) {
    int j;
    for (j = 0; j < s - cs[i] - 1; j++) {
      if (pat[i][j] == -1)
        cout << "  ";
      else
        cout << pat[i][j] << " ";
    }
    cout << pat[i][j] << "\n";
  }
  return 0;
}
