import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1<<30;
enum full = (1<<26) - 1;

void main() {
    string s;
    scan(s);

    int n = s.length.to!int;
    auto dp = new int[](n + 1);
    dp[n] = 1;
    auto next = new int[][](n + 1, 26);
    fillAll(next, inf);
    int b = 0;

    foreach_reverse (i ; 0 .. n) {
        b |= (1<<(s[i] - 'a'));
        if (b == full) {
            dp[i] = dp[i+1] + 1;
            b = 0;
        }
        else {
            dp[i] = dp[i+1];
        }

        foreach (j ; 0 .. 26) {
            if (s[i] - 'a' == j) {
                next[i][j] = i;
            }
            else {
                next[i][j] = next[i+1][j];
            }
        }
    }

    debug {
        writeln(dp);
        writeln;
        writefln("%(%s\n%)", next);
    }

    auto ans = new char[](dp[0]);
    ans[] = '#';
    int pos = 0;

    foreach (i ; 0 .. dp[0]) {
        foreach (c ; 0 .. 26) {
            if (next[pos][c] == inf) {
                ans[i] = ('a' + c).to!char;
                break;
            }
            if (dp[pos] == dp[next[pos][c]+1] + 1) {
                ans[i] = ('a' + c).to!char;
                pos = next[pos][c]+1;
                break;
            }
        }
    }

    writeln(ans);
}










































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
