Fill the grid with digits 1 to n, so that each digit occurs exactly once in every row, every column, every 3x3 box and each of the two main diagonals.