#include <bits/stdc++.h>
int n, r, l, cek1, k;
bool cek;
int main() {
  scanf("%d", &n);
  n = n * 2 + 1;
  r = n;
  l = n;
  cek1 = 1;
  int x = n + n - 1;
  for (int i = 1; i <= n; i++) {
    k = 0;
    cek = true;
    for (int j = 1; j <= r; j++) {
      if (j >= l && cek) {
        printf("%d", k);
        j <= x / 2 ? k++ : k--;
      } else
        printf(" ");
      if (j >= l) {
        if (!cek)
          cek = true;
        else
          cek = false;
      }
    }
    printf("\n");
    if (i > n / 2) cek1 = 0;
    if (cek1) {
      l -= 2;
      r += 2;
    }
    if (!cek1) {
      l += 2;
      r -= 2;
    }
  }
}
