#include<stdio.h>
int n;
int a[110][110];
int main()
{
scanf("%d", &n);
a[0][0] = 1;
for (int i = 1; i < n; i++)//确定对角线的元素
a[i][i] = a[i - 1][i - 1] + 2 * i;
for (int i = 1; i < n; i++) {
for (int j = i - 1; j >= 0; j--) {
a[i][j] = a[i][j + 1] + 1;//妙啊
a[j][i] = a[j + 1][i] - 1;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
printf("%d ", a[i][j]);//可以改成%4d使输出更加好看
}
printf("\n");
}
return 0;
}