// Original C++ solution (slower):


#include<bits/stdc++.h>



using namespace std;

const int maxn = 2e5 + 10;

int Next[maxn][30], now[30], now_tot[maxn];

char s[maxn];

set<int>S;

vector<int>ans;

int main()

{

    ios::sync_with_stdio(false);

cin >> s+1;

        ans.clear();

        int len = strlen(s+1);

        int tot = 0;



        S.clear();

        for(int i = len; i >= 1; i--)

        {

            now_tot[i] = tot;

            S.insert(s[i]-'a');

            if(S.size() == 26)

            {

                tot++;

                S.clear();

            }

        }

        if(tot == 0)

        {

            for(int i = 0; i < 26; i++)

            {

                if(S.count(i) == 0)

                {

                    ans.push_back(i+'a');

                    break;

                }

            }

        }

        else

        {

            for(int i = len; i>= 1; i--)

            {

                for(int  j = 0; j < 26; j++)

                {

                    Next[i][j] = now[j];

                }

                now[s[i]-'a'] = i;

            }

            int tmp = 0;

            for(int i = 0; i < 26; i++)

            {

                if(S.count(i) == 0)

                {

                    tmp = now[i];

                    ans.push_back(s[tmp]);

                    break;

                }

            }

            for(int i = 1; i < tot; i++)

            {

                for(int j = 0; j < 26; j++)

                {

                    if(now_tot[Next[tmp][j]] == now_tot[tmp]-1)

                    {

                        tmp = Next[tmp][j];

                        ans.push_back(s[tmp]);

                        break;

                    }

                }

            }

            for(int i = 0; i < 26; i++)

            {

                if(Next[tmp][i] == 0)

                {

                    ans.push_back(i+'a');

                    break;

                }

            }

        }

        for(int i = 0; i < ans.size(); i++)

        {

            cout << char(ans[i]);

        }

        cout << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#define N 200002

#define M 26



char s[N], a[N], f[N];

int head[M] = {0}, last[N][M], c[N], l;



int dfs(int p, int d)

{

	int i, td = d + 1, tp;

	

	a[d] = s[p], f[d] = 1;

	for(i = 0; i < M; i++){

		if(d + c[tp = last[p][i]] < l){

			if(tp){

				if(td < l && dfs(tp, td)) return 1;

			}

			else{

				a[td] = i + 97, f[td] = 1;

				return 1;

			} 

		}

	}

	f[d] = 0;

	return 0;

}



int main()

{		

	int i, j, m, t, mp, tp;

		

	scanf("%s", s + 1);

	l = strlen(s + 1);

	for(i = l, c[0] = 0; i; i--){

		for(j = 0, m = l; j < M; j++){

			t = c[last[i][j] = head[j]];

			if(t < m) m = t;

		}

		c[i] = m + 1;

		head[s[i] - 97] = i;

	}

	

	for(i = 1, m = c[head[mp = 0]]; i < M; i++){

		if(c[head[i]] < c[head[mp]]) mp = i;

	}

	tp = head[mp];



	if(!tp){

		putchar(mp + 97);

		putchar(10);

		return 0;

	}

	l = c[tp];

	for(i = 0; i <= l; i++) f[i] = 0;	

	dfs(tp, 0);

	a[l + 1] = 0;

	for(i = l; !f[i]; i--) a[i] = 97;

	puts(a);

						

	return 0;

}

// Fastest known solution for this problem: