哈希表
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
String str = br.readLine();
boolean[] used = new boolean[10];
int ans = 0;
for (int i = str.length() - 1; i >= 0; i--) {
char c = str.charAt(i);
if (!used[c - '0']) {
used[c - '0'] = true;
ans = ans * 10 + c - '0';
}
}
pw.println(ans);
pw.flush();
pw.close();
br.close();
}
}