Jane Street interview question

Extremly hard matrix manipulation problem.