import re def main(): S = input() dic = {'<': '>', '>': '<'} after = multiple_replace(S, dic) print(after[::-1]) def multiple_replace(txt, dic): rx = re.compile('|'.join(map(re.escape, dic))) def one_xlat(match): return dic[match.group(0)] return rx.sub(one_xlat, txt) main()