import re
from itertools import count

line = r'#Совп. А# ... #Совп. Б# ... #Совп. В#'
counter = count(1)
line = re.sub(r'#[^#]*#', lambda x: '<{0}>{1}</{0}>'.format(str(next(counter)),x.group()), line)
print(line)