def METHOD_NAME(f1):
    lines = f1.splitlines()
    for i, line in enumerate(lines):
        lines[i] = line.replace('#', '# ').replace('#  ', '# ')
        if '#' in line and not line.strip().startswith('#'):
            lines[i] = lines[i].replace('#', '  #').replace('   #', '  #').replace('   #', '  #')
    return '\n'.join(lines)