#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
int getrand(int l, int r) { // [l, r]
    static random_device rd;
    static uint32_t y = time(NULL);
    y = y ^ (y << 13); y = y ^ (y >> 17);
    y = y ^ (y << 5);
    return y % (r - l + 1) + l;
}
string makeString(int len, string type = "qwertyuiopasdfghjklzxcvbnm") {
    string res = "";
    rep(i, 0, len) res += type[getrand(0, type.size() - 1)];
    return res;
}
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/













string A;
int N;
int dp[201010]; int fast[26];
int to[201010][30];
//---------------------------------------------------------------------------------------------------
string solve() {
    rep(i, 0, 26) fast[i] = -1;
    rrep(i, N - 1, 0) {
        int ng = 0;
        rep(j, 0, 26) to[i][j] = fast[j];
        rep(j, 0, 26) if (fast[j] < 0) ng = 1;
        if (ng) dp[i] = 1;
        else {
            dp[i] = 10101010;
            rep(j, 0, 26) dp[i] = min(dp[i], dp[fast[j]] + 1);
        }

        fast[A[i] - 'a'] = i;
    }

   // rep(i, 0, N) printf("%d ", dp[i]);
   // printf("\n");

    string ans = "";

    rep(i, 0, 26) if (fast[i] < 0) {
        ans += char('a' + i);
        return ans;
    }

    int mi = 10101010;
    rep(i, 0, 26) mi = min(mi, dp[fast[i]]);

    int good = -1;
    rep(i, 0, 26) if (dp[fast[i]] == mi) {
        good = i;
        break;
    }

    int idx = fast[good];
    //printf("[%d]\n", mi);

    while (1 < mi) {
        ans += A[idx];
        int cu = idx;
        idx = -1;
        rep(i, 0, 26) if (dp[to[cu][i]] == mi - 1) {
            idx = to[cu][i];
            break;
        }
        assert(0 <= idx);
        mi--;
    }
    ans += A[idx];
    rep(i, 0, 26) if (to[idx][i] < 0) {
        ans += char('a' + i);
        break;
    }
        
    return ans;
}
//---------------------------------------------------------------------------------------------------
string next(string a) {
    int n = a.length();
    rrep(i, n - 1, 0) {
        if (a[i] == 'z') a[i] = 'a';
        else {
            a[i]++;
            return a;
        }
    }
    return "a" + a;
}
int check(string a) {
    int n = a.length();
    int j = 0;
    rep(i, 0, N) {
        if (a[j] == A[i]) j++;
        if (j == n) return 1;
    }
    return 0;
}
string naive() {
    string x = "a";
    while (check(x)) x = next(x);
    return x;
}
//---------------------------------------------------------------------------------------------------
void test() {
    rep(i, 0, 101) {
        A = makeString(100);
        N = A.length();

        string a = solve();
        string b = naive();

        if (a != b) {
            cout << a << endl;
            cout << b << endl;
            cout << A << endl;
            return;
        }
    }
}
void _main() {
    cin >> A;
    N = A.length();

    cout << solve() << endl;
    //cout << naive() << endl;
}

Measured memory_bytes: 24852