#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 300005
#define INF 100000000
#define mod 1000000007
#define un(x) x.erase( unique( x.begin() , x.end() ) , x.end() )

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << (x) << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;


LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
int setb(int n,int pos){return n=n | (1 << pos);}
int resb(int n,int pos){return n=n & ~(1 << pos);}
bool checkb(int n,int pos){return (bool)(n & (1 << pos));}

int n;
char str[200005];
vector <int> poss[26];
int table[200005][26];

int go(int cur,int id)
{
	int low = 0,high = sz( poss[id] ) - 1,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		int my = poss[id][mid];
		if( my > cur )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	if( ans == -1 )return ans;
	return poss[id][ans];
}

void prework()
{
	int i,j,k;
	Rep(i,n)
	{
		poss[ str[i] - 'a' ].pb( i );
	}
	Rep(i,26)
	{
		int len = sz(poss[i]);
		Rep(j,len)
		{
			Rep(k,26)
			{
				int my = go(poss[i][j],k);
				table[ poss[i][j] ][k] = my;
			}
		}
	}
}

int dp[200005];

int F(int pos)
{
    if(pos == -1)return 0;

    if( dp[pos] != -1 )return dp[pos];

    int ret = 100000000;
    int cur = str[pos] - 'a';
    for(int i = 0; i < 26; i++)
    {
		ret = min( ret , 1 + F( table[pos][i] ) );
    }

    return dp[pos] = ret;
}

char pr[200005];
int l;
void rebuild(int pos)
{
	if( pos == -1 )return;

	int ret = 100000000;
    int cur = str[pos] - 'a';
    int idx = -1;
    for(int i = 0; i < 26; i++)
    {
		int my = 1 + F( table[pos][i] );
		if( my < ret )
		{
			ret = my;
			idx = i;
		}
    }
    if( idx != -1 )
    {
		pr[l++] = idx + 'a';
		rebuild( table[pos][idx] );
    }
}

int main()
{
	//FI;
	ss(str);
	n = strlen(str);
	prework();
	mem(dp,-1);
	int ret = 100000000,idx;
	for(int i = 0; i < 26; i++)
	{
		if( sz(poss[i]) )
		{
			int my = 1 + F( poss[i][0] );
			if( my < ret )
			{
				ret = my;
				idx = i;
			}
		}
		else
		{
			if( ret != 1 )
			{
				ret = 1;
				idx = i;
			}
		}
	}

	if( ret == 1 )printf("%c\n",idx+'a');
	else
	{
		pr[l++] = idx + 'a';
		rebuild(poss[idx][0]);
		pr[l] = 0;
		puts(pr);
	}

	return 0;
}


Measured memory_bytes: 22912