<s> import sys <EOL> import os <EOL> import re <EOL> add_pattern = r'''<STR_LIT>''' <EOL> del_pattern = r'''<STR_LIT>''' <EOL> comm_pattern = r'''<STR_LIT>''' <EOL> gen_comm_pattern = r'''<STR_LIT>''' <EOL> subs_pattern = r'''<STR_LIT>''' <EOL> mark_pattern = r'''<STR_LIT>''' <EOL> test_pattern = '''<STR_LIT>''' <EOL> def deletionProcess ( group_object ) : <EOL> replaceString = '<STR_LIT>' <EOL> if group_object . group ( '<STR_LIT:value>' ) == '<STR_LIT>' : <EOL> replaceString = "<STR_LIT>" <EOL> else : <EOL> replaceString = '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) + '<STR_LIT>' <EOL> return replaceString <EOL> def subsProcess ( group_object ) : <EOL> delString = '<STR_LIT>' + group_object . group ( '<STR_LIT>' ) + '<STR_LIT>' <EOL> insString = '<STR_LIT>' + group_object . group ( '<STR_LIT>' ) + '<STR_LIT>' <EOL> return delString + insString <EOL> def additionProcess ( group_object ) : <EOL> replaceString = '<STR_LIT>' <EOL> if group_object . group ( '<STR_LIT:value>' ) . startswith ( '<STR_LIT>' ) and group_object . group ( '<STR_LIT:value>' ) != "<STR_LIT>" : <EOL> replaceString = "<STR_LIT>" <EOL> replaceString = replaceString + '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) . replace ( "<STR_LIT:\n>" , "<STR_LIT:U+0020>" ) <EOL> replaceString = replaceString + '<STR_LIT>' <EOL> elif group_object . group ( '<STR_LIT:value>' ) == "<STR_LIT>" : <EOL> replaceString = "<STR_LIT>" + '<STR_LIT>' <EOL> elif group_object . group ( '<STR_LIT:value>' ) . endswith ( '<STR_LIT>' ) and group_object . group ( '<STR_LIT:value>' ) != "<STR_LIT>" : <EOL> replaceString = '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) . replace ( "<STR_LIT:\n>" , "<STR_LIT:U+0020>" ) + '<STR_LIT>' <EOL> replaceString = replaceString + "<STR_LIT>" <EOL> else : <EOL> replaceString = '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) . replace ( "<STR_LIT:\n>" , "<STR_LIT:U+0020>" ) + '<STR_LIT>' <EOL> return replaceString <EOL> def highlightProcess ( group_object ) : <EOL> replaceString = '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) . replace ( "<STR_LIT:\n>" , "<STR_LIT:U+0020>" ) + '<STR_LIT>' <EOL> return replaceString <EOL> def markProcess ( group_object ) : <EOL> replaceString = '<STR_LIT>' + group_object . group ( '<STR_LIT:value>' ) + '<STR_LIT>' <EOL> return replaceString <EOL> a = '''<STR_LIT>''' <EOL> h = sys . stdin . read ( ) <EOL> h = re . sub ( del_pattern , deletionProcess , h , flags = re . DOTALL ) <EOL> h = re . sub ( add_pattern , additionProcess , h , flags = re . DOTALL ) <EOL> h = re . sub ( comm_pattern , highlightProcess , h , flags = re . DOTALL ) <EOL> h = re . sub ( mark_pattern , markProcess , h , flags = re . DOTALL ) <EOL> h = re . sub ( subs_pattern , subsProcess , h , flags = re . DOTALL ) <EOL> z = h + a <EOL> sys . stdout . write ( z ) </s>
