while True: try: a = input() b = dict() for i in a: if i not in b.keys(): b[i] = 1 else: b[i] = b[i] + 1 s = "" for i in a: if b[i] != min(b.values()): s = s + i ...