#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int n;
while(scanf("%d", &n), n > 0){
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= n; ++j){
int up = i, down = n - i + 1, right = n - j + 1, left = j;
printf("%d ", min(min(up, down), min(right, left)));
}
printf("\n");
}
printf("\n");
}
return 0;
}