#include<iostream>
using namespace std;
int main()
{
int n,k=1;
cin>>n;
for(int p;p<=n;p++)
{
for(int i=1;i<=n;i++)
{
if(k<10) cout<<"0"<<k;
else cout<<k;
k++;
}
cout<<endl;
}
k=1;
for(int i;i<=n;i++)
{
for(int y=1;y<=n*2;y++)
{
if(y<=(n-i)*2) cout<<" ";
else if(k<10) {cout<<"0"<<k;k++;}
else {cout<<k;k++;}
}
cout <<endl;
}
return 0;
}```