#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  for (int i = 0; i <= n; i++) {
    for (int j = i; j < n; j++) {
      cout << "  ";
    }
    c = 0;
    for (int k = 0; k <= i; k++) {
      if (k == 0 && i == 0)
        cout << c;
      else
        cout << c << " ";
      c++;
    }
    c--;
    for (int k = 1; k <= i; k++) {
      c--;
      if (k == i)
        cout << c;
      else
        cout << c << " ";
    }
    cout << endl;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) cout << "  ";
    c = 0;
    for (int k = i; k < n; k++) {
      if (k == n - 1 && i == n - 1)
        cout << c;
      else
        cout << c << " ";
      c++;
    }
    c--;
    for (int k = i + 1; k < n; k++) {
      c--;
      if (k == n - 1)
        cout << c;
      else
        cout << c << " ";
    }
    cout << endl;
  }
  return 0;
}
