Python Replace String Recursive