#include <cstdio>
int main()
{
int n;
while (scanf("%d", &n), n)
{
for (int i = 0; i < n; i ++ )
{
for (int j = 0; j < n; j ++ )
{
printf("%d ", i - j >= 0 ? i - j + 1 : j - i + 1); //可简化为abs(i - j) +1
}
puts("");
}
puts("");
}
return 0;
}