#include <iostream>
#include <cstdio>
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 ++ )
{
//点(i, j)到上下左右四条边距离的最小值
int up = i, down = n - i + 1, left = j, right = n - j + 1;
cout << min(min(up, down), min(left, right)) << ' ';
}
cout << endl;
}
cout << endl;
}
return 0;
}