import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
/*
删除字符串中出现次数最少的字符;
1.建立map记录每个字符出现次数;
2.找出次数最少字符;
3.数组遍历替换非最少次数字符;
*/
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
//使用Map计数
HashMap<Character, Integer> map = new HashMap<>();
for (int i = 0; i < str.length(); i++) {
map.put((str.charAt(i)),map.getOrDefault(str.charAt(i),0) + 1);
}
//Collections获得出现最小次数
Collection<Integer> values = map.values();
Integer min = Collections.min(values);
//循环替换
for(Character a : map.keySet()){
if(map.get(a) == min){
str = str.replaceAll(String.valueOf(a),"");
}
}
System.out.println(str);
}
}