Untangle the Chain — medium Python for AI problem | Incognition