#include <bits/stdc++.h>
using namespace std;
void print_descending(int n) {
  for (int i = n - 1; i >= 0; i--) cout << " " << i;
}
void print_ascending(int n) {
  for (int i = 0; i < n; i++) {
    cout << i << " ";
  }
}
void print_spaces(int n, int limit) {
  int max_c = limit * 2 + 1;
  int cc = n * 2 + 1;
  for (int i = 0; i < max_c - cc; i++) cout << " ";
}
int main() {
  int n, i;
  while (cin >> n) {
    for (i = 0; i <= n; i++) {
      print_spaces(i, n);
      print_ascending(i);
      cout << i;
      print_descending(i);
      cout << endl;
    }
    for (i = n - 1; i >= 0; i--) {
      print_spaces(i, n);
      print_ascending(i);
      cout << i;
      print_descending(i);
      cout << endl;
    }
  }
  return 0;
}
