Anton And Danik Codeforces Solution In Python