(1) Is there supposed to be a limit for n? It is not given in the problem!
(2) Does anyone know a deterministic approach for converting a set of numbers to natural order? I have not been able to think of a way, and am about to attempt a heuristic search
