Andrey's submission of LIS and LDS | CodeChef