Here is my solution.
1) Sort rows by the first element from largest to lowest.
1 6 5 1 3 3 -\ 3 3 2 4 -/ 2 4 5 1 1 6
2) Divide it into groups from ββnβ and what remains (no more than ββnβ groups)
5 1 5 1 3 3 -\ 3 3 2 4 -/ 1 6 2 4 1 6
3) Sort the rows in each group according to the second element from largest to lowest
5 1 3 3 3 3 5 1 -> 2 4 1 6 1 6 2 4
Proof of correctness:
The increase in subsequences in column 1 can occur in only one group (the size is <= ββnβ),
There are no two elements of increasing subsequences in column 2 in one group (no more than ββnβ groups)
source share