#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n,n){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
//利用min函数取两个方阵的重合值
cout<<min(min(i,j),min(n-i+1,n-j+1))<<' ';
}
cout<<endl;
}
cout<<endl;
}
return 0;
}