mdz's submission of ATM | CodeChef