#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int count = 0, ind;
  int mass[20][20];
  cin >> n;
  count = n + n + 1;
  ind = count / 2;
  for (int i = 0; i <= 19; i++) {
    for (int j = 0; j <= 19; j++) {
      mass[i][j] = 11;
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = i; j >= 0; j--) {
      mass[i][ind - j] = i - j;
      if (j != 0) mass[i][ind + j] = i - j;
    }
  }
  for (int i = 0; i <= ind; i++) {
    for (int j = 0; j <= count; j++) {
      if (mass[i][j] != 11) {
        if (mass[i][j + 1] == 11 && mass[i][j] == 0) {
          cout << mass[i][j];
        } else
          cout << mass[i][j] << " ";
      } else if (j < ind + 1)
        cout << "  ";
    }
    cout << "\n";
  }
  for (int i = ind - 1; i >= 0; i--) {
    int bl = 0;
    for (int j = 0; j <= count; j++) {
      if (mass[i][j] != 11) {
        if (mass[i][j + 1] == 11 && mass[i][j] == 0) {
          cout << mass[i][j];
        } else
          cout << mass[i][j] << " ";
      } else if (j < ind + 1)
        cout << "  ";
    }
    cout << "\n";
  }
  return 0;
}
