#include <iostream>
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++)
{
int up = i, left = j, down = n - i + 1, right = n - j + 1;
int x = min(min(up, left), min(down, right));
cout << x << " ";
}
cout << endl;
}
cout << endl;
}
return 0;
}