import re
sentence = "a b cc e ddd f g h"
pattern = re.compile(r'\b([a-z]) (?=[a-z]\b)', re.I)
sentence = re.sub(pattern, r'\g<1>', sentence)
print(sentence)
aW1wb3J0IHJlCnNlbnRlbmNlID0gImEgYiBjYyBlIGRkZCBmIGcgaCIKcGF0dGVybiA9IHJlLmNvbXBpbGUocidcYihbYS16XSkgKD89W2Etel1cYiknLCByZS5JKQpzZW50ZW5jZSA9IHJlLnN1YihwYXR0ZXJuLCByJ1xnPDE+Jywgc2VudGVuY2UpCnByaW50KHNlbnRlbmNlKQ==