#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, m, i, k, s, h, j, n1;
  char t[200], t1[200];
  cin >> n;
  l = 0;
  while (l <= n) {
    t[l] = l + '0';
    l++;
  }
  n1 = n - 1;
  i = 0;
  while (i < n) {
    t1[n1 - i] = i + '0';
    i++;
  }
  int e = 2 * n - 1;
  s = n;
  k = 0;
  while (s >= 0) {
    for (j = 0; j <= e; j++) {
      cout << " ";
    }
    s--;
    if (k == 0) {
      cout << '0';
    } else {
      for (m = 0; m <= k; m++) {
        cout << t[m] << " ";
      }
    }
    for (h = n1 - k + 1; h <= n1 - 1; h++) {
      cout << t1[h] << " ";
    }
    if (k != 0) cout << t1[n1];
    k++;
    e -= 2;
    cout << endl;
  }
  int e2 = 1;
  int s1 = 0;
  int k1 = n1;
  while (s1 < n) {
    for (j = 0; j <= e2; j++) {
      cout << " ";
    }
    e2 += 2;
    if (k1 == 0) {
      cout << '0';
      break;
    }
    for (m = 0; m <= k1; m++) {
      cout << t[m] << " ";
    }
    for (h = n1 - k1 + 1; h <= n1 - 1; h++) {
      cout << t1[h] << " ";
    }
    if (k1 != 0) cout << t1[n1];
    s1++;
    k1--;
    cout << endl;
  }
}
