<s> import sys <EOL> def msfpattern ( n ) : <EOL> """<STR_LIT>""" <EOL> def inc ( alphas , indexes , i ) : <EOL> indexes [ i % <NUM_LIT:3> ] += <NUM_LIT:1> <EOL> if indexes [ i % <NUM_LIT:3> ] >= len ( alphas [ i % <NUM_LIT:3> ] ) : <EOL> indexes [ i % <NUM_LIT:3> ] = <NUM_LIT:0> <EOL> inc ( alphas , indexes , i - <NUM_LIT:1> ) <EOL> return <EOL> alphas = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> indexes = [ <NUM_LIT:0> ] * len ( alphas ) <EOL> chars = [ ] <EOL> for i in range ( n ) : <EOL> chars . append ( alphas [ i % <NUM_LIT:3> ] [ indexes [ i % <NUM_LIT:3> ] ] ) <EOL> if i % <NUM_LIT:3> == <NUM_LIT:2> : <EOL> inc ( alphas , indexes , i ) <EOL> return "<STR_LIT>" . join ( chars ) <EOL> def make_pattern ( buffer_size , start_index = <NUM_LIT:1> , max_index = <NUM_LIT> ) : <EOL> format_size = buffer_size // <NUM_LIT:2> <EOL> pattern_size = buffer_size // <NUM_LIT:8> <EOL> index = start_index <EOL> payload = msfpattern ( pattern_size * <NUM_LIT:4> ) <EOL> while True : <EOL> fmt = "<STR_LIT:%>" + str ( index ) + "<STR_LIT>" <EOL> if len ( payload ) + len ( fmt ) > buffer_size : <EOL> break <EOL> payload += fmt <EOL> index += pattern_size - <NUM_LIT:1> <EOL> if index > max_index : <EOL> break <EOL> return payload . ljust ( buffer_size , "<STR_LIT:X>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> sys . stdout . write ( make_pattern ( * map ( int , sys . argv [ <NUM_LIT:1> : ] ) ) ) <EOL> else : <EOL> print "<STR_LIT>" </s>
