Rosetta Problems

Lexicographically smallest path

https://marisaoj.com/problem/369