/*
   ЗАПУСКАЕМ СТЕНУ ИЗ КРЕМА
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
   💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩💩
*/

#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <iomanip>
#define end abacaba

using namespace std;

typedef long long ll;

mt19937 rnd(228);

const int N = 2e5 + 1;

int go[N][26];
int pr[N];
int ch[N];
int dp[N];
bool vis[N];
bool end[N];
int best = 1e9;

void restore(int i)
{
    if (end[i])
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] == -1)
            {
                cout << char(j + 'a');
                exit(0);
            }
        }
    }
    else
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] != -1 && vis[go[i][j]] && dp[go[i][j]] == dp[i] + 1)
            {
                cout << char(j + 'a');
                restore(go[i][j]);
            }
        }
    }
}

int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    string s;
    cin >> s;
    int n = (int) s.size();
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            go[i][j] = -1;
        }
    }
    for (int i = n - 1; i >= 0; i--)
    {
        for (int j = 0; j < 26; j++)
        {
            if (s[i] == (j + 'a'))
            {
                go[i][j] = i + 1;
            }
            else
            {
                if (i != n - 1)
                {
                    go[i][j] = go[i + 1][j];
                }
                else
                {
                    go[i][j] = -1;
                }
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        dp[i] = 1e9;
    }
    dp[0] = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] != -1 && dp[go[i][j]] > dp[i] + 1)
            {
                dp[go[i][j]] = dp[i] + 1; 
                pr[go[i][j]] = i;
                ch[go[i][j]] = j;
            }
        }
    }
    int last = -1;
    int st = -1;
    int ans = 1e9;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] == -1 && dp[i] < ans)
            {
                ans = dp[i];
                st = i;
                last = j;
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] == -1 && dp[i] == ans)
            {
                vis[i] = true;
                end[i] = true;
            }
        }
    }
    for (int i = n - 1; i >= 0; i--)
    {
        for (int j = 0; j < 26; j++)
        {
            if (go[i][j] != -1 && dp[go[i][j]] == dp[i] + 1 && vis[go[i][j]])
            {
                vis[i] = true;
            }
        }
    }
    restore(0);
}


Measured memory_bytes: 23940