Nikolay Domashenko's submission of Turn It | CodeChef