#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <list>
#include <bitset>
#include <vector>
using namespace std;

#define I64d_OJ

//#ifdef I64d_OJ
//#define LL __int64
//#endif // I64d_OJ
#ifdef I64d_OJ
#define LL long long
#endif // I64d_OJ

typedef unsigned LL ULL;
typedef unsigned uint;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;
typedef vector<int> vi;

inline LL read(){
    LL x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls rt<<1
#define rs rt<<1|1
#define MID(a,b) (((LL)(a)+(LL)(b))>>1)
#define absx(a) ((a)<0?-(a):(a))
#define MK(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define lowbit(x) ((x)&-(x))

template< typename T >
inline void Max(T &a,T &b){if(a<b) a=b;}
template< typename T>
inline void Min(T &a,T &b){if(a>b) a=b;}

const double pi=(double)acos(-1.0);
const double eps=(double)1e-10;
const int INF = (int) 0x3f3f3f3f;
const int MOD = (int) 1e9+7;
const int MAXN =(int) 2e5+100;
const int MAXM = (int) 1e5+10;

///--------------------START-------------------------
char s[MAXN];
int nxt[MAXN][30];
int len;
int mark[MAXN];
int pre[MAXN];
int pp[MAXN];

struct Edge{
    int u,v;
    int next;
}edge[MAXN*50];
int head[MAXN];
int edgenum;

void Init(){
    memset(head,-1,sizeof(head));
    edgenum=0;
}

void AddEdge(int u,int v){
    edge[edgenum].u=u;
    edge[edgenum].v=v;
    edge[edgenum].next=head[u];
    head[u]=edgenum++;
}
int dist[MAXN];
int vis[MAXN];

void SPFA(int st){
    queue<int> q;
    memset(dist,INF,sizeof(dist));
    memset(vis,0,sizeof(vis));

    q.push(st);
    vis[st]=1;
    dist[st]=0;
    while(!q.empty()){
        int u=q.front(); q.pop();
        vis[u]=0;
//        printf("u = %d\n",u);
        for(int i=head[u];~i;i=edge[i].next){
            int v=edge[i].v;
            if((dist[u]+1<dist[v])||(dist[u]+1==dist[v]&&s[pp[v]]>s[u])){
                dist[v]=dist[u]+1;
                pp[v]=u;
//                printf("%c->%c\n",s[u],s[v]);
//                printf("pre[%d] = %d\n",v,u);
                if(!vis[v]){
                    q.push(v);
                    vis[v]=1;
                }
            }
//            else if(v==len+1){
////                printf("len+1 : %c %c\n",s[pp[v]],s[u]);
//            }
        }
    }
}

void print(int cur){
//    printf("cur = %d , len + 27 = %d\n",cur,len+27);
    if(cur!=0&&cur!=len+27) printf("%c",s[cur]);
    if(pp[cur]!=0) print(pp[cur]);
//    if(cur==len+1) return;
//    printf("%c",s[cur]);
}

void work(){
    scanf("%s",s+1);
    len=strlen(s+1);
    for(int i=0;i<26;i++){
        s[len+1+i]='a'+i;
        mark[i]=len+1+i;
    }
    Init();
    for(int i=1;i<=len;i++){
        if(!pre[s[i]-'a']){
            pre[s[i]-'a']=i;
            AddEdge(i,0);
//            printf("%d -> %d\n",0,i);
        }
    }
//    return;
    for(int i=0;i<26;i++)if(!pre[i]){
        printf("%c\n",'a'+i);
        return;
    }
    for(int i=len;i>=1;i--){
        for(int j=0;j<26;j++){
            AddEdge(mark[j],i);
//            if(i==1) printf("i==1 : %d -> %d\n",i,mark[j]);
        }
        mark[s[i]-'a']=i;
    }
    for(int i=0;i<26;i++){
        AddEdge(len+27,len+1+i);
    }
//    return;
    SPFA(len+27);
//    int mi=INF,pos=0;
//    for(int i=0;i<26;i++){
//        printf("%c : %d\n",'a'+i,dist[len+1+i]);
//    }
//    for(int i=0;i<26;i++){
//        if(dist[len+1+i]<mi){
//            pos=len+1+i;
//            mi=dist[len+1+i];
////            printf("%d %d\n",dist[len+1+i],mi);
//        }
//    }
//    printf("pos = %c\n",s[pos]);
    print(0);
    printf("\n");
}

///--------------------END-------------------------
int main(){
#ifdef NNever
//freopen("data.in","r",stdin);
///freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}







Measured memory_bytes: 70656