#include <bits/stdc++.h>
using namespace std;
struct nodo {
  int x, y, amount;
};
int main() {
  int n;
  cin >> n;
  vector<char> d = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
  vector<vector<int>> m(n * 2 + 1, vector<int>(2 * n + 1));
  vector<vector<bool>> visited(2 * n + 1, vector<bool>(2 * n + 1, false));
  queue<nodo> q;
  q.push({n, n, n});
  while (!q.empty()) {
    nodo next = q.front();
    q.pop();
    int x = next.x;
    int y = next.y;
    m[x][y] = next.amount;
    visited[x][y] = true;
    if (x - 1 >= 0 && !visited[x - 1][y]) q.push({x - 1, y, next.amount - 1});
    if (x + 1 < m.size() && !visited[x + 1][y])
      q.push({x + 1, y, next.amount - 1});
    if (y - 1 >= 0 && !visited[x][y - 1]) q.push({x, y - 1, next.amount - 1});
    if (y + 1 < m.size() && !visited[x][y + 1])
      q.push({x, y + 1, next.amount - 1});
  }
  for (auto& i : m) {
    string line;
    for (int j : i) {
      if (j < 0)
        line.push_back(' ');
      else
        line.push_back(d[j]);
      line.push_back(' ');
    }
    while (line.back() == ' ') line.pop_back();
    cout << line << endl;
  }
}
