Fill the grid with numbers 1 to n² such that rows labeled A are in ascending order (left→right) and rows labeled D are in descending order. The same applies to columns (top→bottom).
Click on row/column labels to toggle between A and D. Click a number, then click a cell to place it.