import re


def _replace_type_with_say(text: str) -> str:
    """
    >>> _replace_type_with_say("TYPED")
    'TYPED'

    >>> _replace_type_with_say("TYPE")
    'SAY'

    >>> _replace_type_with_say("TYPE W RATHER THAN WEST")
    'SAY W RATHER THAN WEST'

    >>> _replace_type_with_say('WELCOME TO ADVENTURE!! WOULD YOU LIKE INSTRUCTIONS? - - - (TYPE "RESTART" TO RESTART THE GAME.)')  #doctest: +ELLIPSIS
    'WELCOME...SAY "RESTART"...'
    """
    return re.sub(r"\bTYPE\b", "SAY", text, flags=re.IGNORECASE)