#include <iostream>
#include <string>
#include <map>
using namespace std;

int main()
{
	string str;
	cin >> str;
	int order = 1;
	map<char, int> m;
	for(int i=str.size()-1; i>=0; i--) {
		if(m.find(str[i]) == m.end()) {
			m[str[i]] = order;
			order++;
		}
	}
	for(map<char, int>::iterator it=m.begin(); it!=m.end(); it++) {
		cout << order - it->second;
	}
	cout << endl;
}