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