#include <iostream>
#include <unordered_map>
using namespace std;
int main() {
string num;
while (cin >> num) { // 注意 while 处理多个 case
unordered_map<char, int> map;
string output;
// 输入的数倒序输出
for (int i = num.size()-1; i >= 0; i --) {
//判断是否出现在hash map中
if (map.find(num[i]) != map.end()) { // 已经出现在hash map中,略过
continue;
} else { // 没有出现在hash map中,打包字符串output, 并作标记
output += num[i];
map[num[i]] ++;
}
}
// for (auto & it : map) {
// output += it.first;
// }
cout << output << endl;
}
}
// 64 位输出请用 printf("%lld")