#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n=0;
while(cin>>n,n)
{
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
int a=i,b=j,c=n-i+1,d=n-j+1;
cout<<min(min(a,b),min(c,d))<<' ';
}
cout<<endl;
}
cout<<endl;
}
return 0;
}