s = "AC;AC MR;TA;AC MR;AC;AC MR;TA;SDA"print(";".join([x.replace(' ', '') for x in dict.fromkeys(s.split(";"))]))
Standard input is empty
AC;ACMR;TA;SDA
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!