#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[2 * n - 1][2 * n - 1];
  int v = 0, k = n;
  for (int i = 0; i < n; i++, k--, v++) {
    for (int j = 0; j < k; j++) printf("  ");
    for (int j = 0; j < v; j++) printf("%d ", j);
    printf("%d", v);
    for (int j = v - 1; j >= 0; j--) printf(" %d", j);
    printf("\n");
  }
  for (int i = 0; i < n; i++) printf("%d ", i);
  printf("%d", n);
  for (int i = n - 1; i >= 0; i--) printf(" %d", i);
  for (int i = 0, k = 1, v = n - 1; i < n; i++, k++, v--) {
    printf("\n");
    for (int j = 0; j < k; j++) printf("  ");
    for (int j = 0; j < v; j++) printf("%d ", j);
    printf("%d", v);
    for (int j = v - 1; j >= 0; j--) printf(" %d", j);
  }
  return 0;
}
