python solution

welcome to shbcf.ru