#include <iostream>
using namespace std;
int min(int a,int b,int c,int d){
if(a<b&&a<c&&a<d)return a;
else if(b<c&&b<d)return b;
else if(c<d)return c;
else return d;
}
int main()
{
int num;cin >> num;
while(num)
{
for(int i = 0; i < num; i ++){
for(int j = 0; j < num; j ++)
cout << min(i+1, j+1, num-i, num-j) << " ";
cout << endl;
}
cout << endl;
cin >> num;
}
return 0;
}