#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> napis;
  string str = "";
  for (int i = 0; i <= n; i++) {
    for (int z = 0; z < 2 * (n - i); z++) {
      cout << " ";
      str += " ";
    }
    for (int j = 0; j < i; j++) {
      cout << j << " ";
      str += (char)('0' + j);
      str += " ";
    }
    for (int j = i; j >= 0; j--) {
      if (j != 0) {
        cout << j << " ";
        str += (char)('0' + j);
        str += " ";
      } else {
        cout << j;
        str += (char)('0' + j);
      }
    }
    cout << "\n";
    napis.push_back(str);
    str = "";
  }
  int len = napis.size();
  for (int i = 1; i < napis.size(); i++) {
    cout << napis[len - i - 1] << "\n";
  }
  return 0;
}
