Python Replace String Between Two Strings Codeforces Handle