Replacing all fixed size substring of string - Pyhton : I have the following problem: 
1. I have a very long string (len of strings = 54883508)
2. I need to replace all sub-strings in a very short time


The string contains stuff following this pattern: aaaaaaaaaaaaaaaaaaaaaaXXXXXXXXXCCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaXXXXXXXXXCCaaaaaaaaaaXXXXXXXXXCCaaaaaaaaaaaaXXXXXXXXXCCaaaaaaaaaaaaaaaaXXXXXXXXXCCaaXXXXXXXXXCCaXXXXXXXXXCCaaaaaaaaaaaaaaaaaaaaXXXXXXXXXCC

I need to replace XXXXXXXXXCC but the only thing I know is the position of CC as XXXXXXXXX is dynamic and random.

Any ideea?