#include<iostream>
#include
using namespace std;
int main()
{
int a,b,c=1;
cin>>a;
for(int i=1;i<=a;i++)
{
for(int j=0;j<a;j++)
{
b++;
if(b>9)
{
cout<<b;
}
else
{
cout<<"0"<<b;
}
}
cout<<'\n';
}
cout<<'\n';
for(int i2=a;i2>0;i2--)
{
for(int j2=1;j2<=a;j2++)
{
if(j2>=i2)
{
if(c>9)
{
cout<<c;
}
else
{
cout<<"0"<<c;
}
c++;
}
else
{
cout<<" ";
}
}
cout<<'\n';
}
return 0;
}