#NEWLINE# def main( ) : #NEWLINE# #INDENT# issues = OrderedDict ( ) #NEWLINE# while True : #NEWLINE# #INDENT# line = sys . stdin . readline ( ) #NEWLINE# if ( not issues ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if re . search ( section_pat , line ) : #NEWLINE# #INDENT# for id in issues : #NEWLINE# #INDENT# print ( anchor_pat . format ( id = id ) . rstrip ( ) ) #NEWLINE# #UNINDENT# if issues : #NEWLINE# #INDENT# print ( '\n' ) #NEWLINE# #UNINDENT# issues = OrderedDict ( ) #NEWLINE# #UNINDENT# for m in re . finditer ( pat , line ) : #NEWLINE# #INDENT# id = m . group ( 2 ) #NEWLINE# if ( id not in issues ) : #NEWLINE# #INDENT# issues [ id ] = True #NEWLINE# #UNINDENT# #UNINDENT# print ( re . sub ( pat , rep_pat , line ) . rstrip ( ) ) #NEWLINE# #UNINDENT# pass