<s> """<STR_LIT>""" <EOL> import sys <EOL> import re <EOL> def bwt ( s ) : <EOL> s = s + '<STR_LIT>' <EOL> return '<STR_LIT>' . join ( [ x [ - <NUM_LIT:1> ] for x in <EOL> sorted ( [ s [ i : ] + s [ : i ] for i in range ( len ( s ) ) ] ) ] ) <EOL> def ibwt ( s ) : <EOL> L = [ '<STR_LIT>' ] * len ( s ) <EOL> for i in range ( len ( s ) ) : <EOL> L = sorted ( [ s [ i ] + L [ i ] for i in range ( len ( s ) ) ] ) <EOL> return [ x for x in L if x . endswith ( '<STR_LIT>' ) ] [ <NUM_LIT:0> ] [ : - <NUM_LIT:1> ] </s>
