from collections import OrderedDict as O #s=input() f=lambda s:"".join([c*(s.count(c)&-2)for c in O.fromkeys(s)])print(f("CAB"))
Standard input is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!