Fill the grid with digits 1 to 5 (1-4 for the example) so that each digits appears exactly once in every row and column. Where the digits adjoin vertically, the upper digit must be bigger.