import re


def replaceThreeOrMore(word):
    """
    look for 3 or more repetitions of letters and replace with this letter itself only once
    """
    pattern = re.compile(r"(.)\1{3,}", re.DOTALL)
    return pattern.sub(r"\1", word)