#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const int MAX = 4e6 + 5;
const int N = 1e5 + 5;
int dx[] = {2, -2, 2, -2, -1, -1, 1, 1};
int dy[] = {1, 1, -1, -1, 2, -2, 2, -2};
char dir[] = {'U', 'R', 'D', 'L'};
int power(int a, int b);
int powmod(int a, int b, int mod);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = -n; i <= n; i++) {
    for (int j = -n; j <= n; j++) {
      if (abs(i) + abs(j) - n == 0 && j >= 0)
        cout << abs(abs(i) + abs(j) - n);
      else if (abs(i) + abs(j) - n <= 0)
        cout << abs(abs(i) + abs(j) - n) << " ";
      else if (j <= 0)
        cout << "  ";
    }
    cout << "\n";
  }
}
int power(int a, int b) {
  int res = 1;
  while (b) {
    if (b % 2) res *= a;
    b /= 2, a *= a;
  }
  return res;
}
int powmod(int a, int b, int mod) {
  int res = 1;
  while (b) {
    if (b % 2) res *= a % mod;
    b /= 2, a *= a % mod;
  }
  return res % mod;
}
