import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) throws Exception{ Scanner sc = new Scanner(System.in); while(sc.hasNextLine()){ String s = sc.nextLine(); HashSet<Character> set = new HashSet<>(); ArrayList<Character> list = new ArrayList<>(); for(int i = s.length() - 1; i >= 0; --i){ if(!set.contains(s.charAt(i))){ set.add(s.charAt(i)); list.add(s.charAt(i)); } } for(int i = 0; i < list.size(); ++i){ System.out.print(list.get(i)); } System.out.println(); } } }