def shanchu(a): for i in range(value[a]): list_s.remove(a) while True: try: value = {} s = input() list_s = list(s) #print(list_s) for i in s: if i not in value.keys(): value[i] = s.count(i) #print(value) new = sorted(value,key=lambda x:value[x]) #print(value[new[0]]) shanchu(new[0]) #print(list_s) for i in range(1,len(new)): if value[new[i]] == value[new[0]]: shanchu(new[i]) print(*list_s,sep='') except: break