Sergey Kulik's submission of Daily Train | CodeChef