import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
String str =sc.nextLine(); String[] array = str.split(""); Map<String,Integer> map = new HashMap<>(); for (int i = 0; i < array.length; i++) { String string = array[i]; if(map.containsKey(string)) { map.put(string, map.get(string)+1); }else { map.put(string, 1); } } List<Map.Entry<String, Integer>> ls = new ArrayList<>(map.entrySet()); Collections.sort(ls,new Comparator<Map.Entry<String, Integer>>() { @Override public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) { return o1.getValue().compareTo(o2.getValue()); } }); int m=ls.get(0).getValue();
for(Map.Entry<String, Integer> ma:ls) {
if(ma.getValue()>m) {
break;
}else {
str = str.replaceAll(ma.getKey(), "");
}
}
System.out.println(str);
}
}}