#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long pow(long long x, long long n) {
  if (x == 0) return 1;
  long long ans = 1;
  while (n > 0) {
    if ((n & 1LL) == 1LL) ans = ans * x;
    x *= x;
    n >>= 1;
  }
  return ans;
}
long long powMOD(long long x, long long n) {
  if (x == 0) return 1LL;
  long long ans = 1LL;
  while (n > 0) {
    if ((n & 1LL) == 1LL) ans = ((ans % MOD) * (x % MOD) % MOD);
    x = ((x % MOD) * (x % MOD)) % MOD;
    n >>= 1;
  }
  return ans;
}
vector<bool> sieve(long long n) {
  vector<bool> isPrime(max(0LL, n + 1), true);
  if (n < 0) return isPrime;
  isPrime[0] = false;
  if (n == 0) return isPrime;
  isPrime[1] = false;
  if (n == 1) return isPrime;
  for (long long i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (long long j = i * i; j <= n; j += i) {
        isPrime[j] = false;
      }
    }
  }
  return isPrime;
}
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
pair<long long, long long> ext_gcd(long long a, long long b) {
  if (a < b) return ext_gcd(b, a);
  if (b == 0) return {1, 0};
  pair<long long, long long> ans = ext_gcd(b, a % b);
  long long x = ans.first;
  long long y = ans.second;
  return {y, x - (a / b) * y};
}
void solve() {
  long long n;
  cin >> n;
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j < n - i; j++) {
      cout << "  ";
    }
    for (long long j = 0; j <= i; j++) {
      if (j != i)
        cout << j << " ";
      else
        cout << j;
    }
    for (long long j = i - 1; j >= 0; j--) {
      cout << " " << j;
    }
    cout << "\n";
  }
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = 0; j < n - i; j++) {
      cout << "  ";
    }
    for (long long j = 0; j <= i; j++) {
      if (j != i)
        cout << j << " ";
      else
        cout << j;
    }
    for (long long j = i - 1; j >= 0; j--) {
      cout << " " << j;
    }
    cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
