#include <iostream>
#include <string>
#include <cstring>

const int eps = 'z' - 'a' + 1;
const int ms = 200200;
const int INF = 1e9;

std::string str;
int nxt[ms][eps];
int height[ms];
int to[ms];

int main()
{
	std::cin >> str;
	str = "#" + str;
	int n = str.size();
	for(int i = 0; i < ms; i++)
	{
		for(int j = 0; j < eps; j++)
		{
			nxt[i][j] = n;
		}
	}
	memset(height, 0x3f, sizeof height);
	for(int i = n - 2; i >= 0; i--)
	{
		for(int j = 0; j < eps; j++)
			nxt[i][j] = nxt[i + 1][j];
		nxt[i][str[i + 1] - 'a'] = i + 1;
	}
	height[n] = 0;
	for(int i = n - 1; i >= 0; i--)
	{
		for(int j = 0; j < eps; j++)
		{
			if(1 + height[nxt[i][j]] < height[i])
			{
				to[i] = j;
				height[i] = 1 + height[nxt[i][j]];
			}
		}
	}
	std::string ans;
	int on = 0;
	while(on != n)
	{
		ans += 'a' + to[on];
		on = nxt[on][to[on]];
	}
	std::cout << ans << "\n";
}