#include <iostream>
#include <cstdio>
using namespace std;
const int N = 110;
int g[N][N];
int main()
{
int n;
while (cin >> n && n != 0)
{
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
{
int dx = min(i, n - i + 1);
int dy = min(j, n - j + 1);
g[i][j] = min(dx, dy);
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
cout << g[i][j] << ' ';
puts("");
}
puts("");
}
return 0;
}