https://www.spoj.com/problems/ARRANGE/