import java.util.Scanner;

public class Section042 {
	public static void main(String[] args) {
		Scanner scanf = new Scanner(System.in); 
		int x, m, L, i, j, k;
		x = scanf.nextInt();
		int a[][] = new int[x][x];
		k = 0;
		L = x;
		m = x / 2;
		for (i = 0; i <= m; i++)
		{
			L--;
			for (j = i; j <= L; j++)
			{
				k++;
				a[i][j] = k;
			}
		}
		for (i = m + 1; i <= x - 1; i++)
		{
			L--;
			for (j = L; j <= i; j++)
			{
				k++;
				a[i][j] = k;
			}
		}
		for (int y = 0; y < x; y++)
		{
			for (int z = 0; z < x; z++)
				System.out.printf("%3d", a[y][z]);
			System.out.printf("\n");
		}
		scanf.close();
	}
}
