#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int x;
while(cin>>x,x){
for(int i=1;i<=x;i++){
for(int j=1;j<=x;j++){
int up = i,down=x-i+1,left=j,right=x-j+1;
cout<<min(min(up,down),min(left,right))<<" ";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
输出的每个位置的值是其离上下左右四个遍最近的数值