#include<iostream>
using namespace std;
int main(){
int n,a;
cin>>n;
while(n){
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
a = min(min(min(i,j),n-i-1),n-j-1);
printf("%d ",a+1);
}
printf("\n");
}
printf("\n");
cin>>n;
}
return 0;
}