import re


def small_titles(markdown):
    """Make titles smaller, eg replace '# ' with '### ' at the start of a line."""
    markdown = re.sub(r'\n# |^# ', '\n### ', markdown)
    markdown = re.sub(r'\n## |^##', '\n#### ', markdown)
    return markdown