#include
using namespace std;
int main() {
int n;
cin>>n;
int nsp=2n-1;
int nst=1;
for(int row=1;row<=2n-1;row++)
{
int val=n;
for(int cst=1;cst<=nst;cst++)
{
cout<<val;
val–;
}
for(int csp=1;csp<=nsp;csp++)
{
cout<<" ";
}
int cst=1;
val++;
for( ;cst<=nst;cst++)
{
if(val==0)
{
val++;
continue;
}
else{
cout<<val;
val++;
}
}
if(row<=n+1)
{
nst+=1;
nsp-=2;
}
else
{
nst-=1;
nsp+=2;
}
cout<<endl;
}
return 0;
}