include”bits/stdc++.h”
using namespace std;
int a[100][100];
int n;
int main()
{
while (cin >> n,n)
{
for (int i = 0; i < n; i )
{
for(int j = 0; j < n; j )
{
a[i][j] = abs(i - j) + 1;
}
}
for (int i = 0; i < n; i ++ )
{
for (int j = 0; j < n; j ++ )
{
cout << a[i][j] <<" ";
}
cout << endl;
}
cout << endl;
}
return 0;
}