#include <iostream>
using namespace std;
int n;
int main(){
cin >> n;
for(int i = 0; i < n + 1; ++i){ // 行
int j = 0, k = 0;
for(; j < n - i; ++j) cout << " ";
for(; j < n; ++j) cout << k++ << " ";
while(k+1) cout << k-- << " ";
cout << endl;
}
for(int i = 0; i < n; ++i){
int j = 0, k = 0;
for(; j < i + 1; ++j) cout << " ";
for(; j < n; ++j) cout << k++ << " ";
while(k+1) cout << k-- << " ";
cout << endl;
}
return 0;
}