public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        if (scan.hasNext()){
            String line = scan.nextLine();     //nextLine()该方法返回输入回车之前的所有输入的字符,并且可以回去空白。
                                               // next()方***过滤有效字符前面的无效字符,别u:空格、Tab键、Enter键等结束符
            String result = "";
            for (int i = line.length(); i > 0; i--) {
                if (!result.contains(line.substring(i-1,i))) {    //substring(int beginIndex, int endIndex)返回字符串中的子字符串
                                                                  //contains()判断字符串中是否包含指定的字符串或者字符
                    result += line.substring(i-1,i);     //不包含在result里面的字符,添加进去
                }
            }
            System.out.println(result);
        }
        scan.close();
    }
}