#include <bits/stdc++.h>
using namespace std;
const long long OO = (4e18) + 9;
const int MOD = (1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int dX[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dY[] = {0, 1, 0, -1, 1, 1, -1, -1};
string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiou";
int dcmp(long double d1, long double d2) {
  return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1;
}
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int ord(int r, int c, int nCol) { return (nCol * r) + c + 1; }
pair<int, int> rord(int n, int nCol) {
  int r = n % nCol, c = n / nCol;
  if (n % nCol == 0) c--, r = nCol;
  return pair<int, int>(r, c);
}
long long poww(long long num, long long p, long long md = MOD) {
  num %= md;
  long long ret = 1;
  while (p > 0) {
    if (p & 1) ret = (ret * num) % md;
    num = (num * num) % md;
    p >>= 1;
  }
  return ret;
}
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * nCr(n - 1, r - 1) / r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0, sp = 2 * n; i < n; i++, sp -= 2) {
    for (int j = 0; j < sp; j++) cout << ' ';
    for (int j = 0; j < i + 1; j++) {
      cout << j;
      if (j != i) cout << ' ';
    }
    for (int j = i - 1; j >= 0; j--) {
      if (j == i - 1) cout << ' ';
      cout << j;
      if (j) cout << ' ';
    }
    cout << endl;
  }
  for (int i = 0; i < n + 1; i++) cout << i << ' ';
  for (int i = n - 1; i >= 0; i--) {
    cout << i;
    if (i) cout << ' ';
  }
  cout << endl;
  for (int i = n - 1, sp = 2; i >= 0; i--, sp += 2) {
    for (int j = 0; j < sp; j++) cout << ' ';
    for (int j = 0; j < i + 1; j++) {
      cout << j;
      if (j != i) cout << ' ';
    }
    for (int j = i - 1; j >= 0; j--) {
      if (j == i - 1) cout << ' ';
      cout << j;
      if (j) cout << ' ';
    }
    cout << endl;
  }
  return 0;
}
