#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


string str;

const int MAX = 210000;
vector<int> place[30];
int nex[MAX][30];


int dp[MAX][30];
int ne[MAX][30];

string solve() {
    for (int i = 0; i < str.size(); ++i) {
        int id = str[i] - 'a';
        place[id].push_back(i);
    }
    for (int i = 0; i < 26; ++i) {
      char c = 'a' + i;
      string res = ""; res += c;
      if (place[i].empty()) return res;
    }
    for (int i = 0; i < str.size(); ++i) {
      for (int j = 0; j < 26; ++j) {
	int it = upper_bound(place[j].begin(), place[j].end(), i) - place[j].begin();
	if (it == place[j].size()) nex[i][j] = -1;
	else nex[i][j] = place[j][it];
      }
    }
    
    for (int i = 0; i < MAX; ++i) {
      for (int j = 0; j < 30; ++j) {
	dp[i][j] = 1<<29;
	ne[i][j] = -1;
      }
    }

    for (int j = 0; j < 26; ++j) {
      dp[str.size()][j] = 1;
    }
    for (int i = str.size(); i >= 0; --i) {
      int c = str[i] - 'a';
      for (int j = 0; j < 26; ++j) {
	if (j == c) continue;
	if (chmin(dp[i][j], dp[i+1][j])) {
	  ne[i][j] = ne[i+1][j];
	}
      }
      int Min = 1<<29;
      int MinC = -1;
      for (int j = 0; j < 26; ++j) {
	if (chmin(Min, dp[i+1][j])) {
	  MinC = j;
	}
      }
      if (chmin(dp[i][c], dp[i+1][MinC]+1)) {
	ne[i][c] = nex[i][MinC];
      }

      for (int j = 0; j < 26; ++j) {
	//cout << i << "(" << str[i] << "), " << (char)('a' + j) << ": " <<
	//  dp[i][j] << ", " << ne[i][j] << ", " << str[ne[i][j]] << endl;
      }
    }

    string res = "";
    int Min = 1<<29;
    int MinC = -1;
    for (int j = 0; j < 26; ++j) {
      if (chmin(Min, dp[0][j])) MinC = j;
    }
    int pos = lower_bound(place[MinC].begin(), place[MinC].end(), 0) - place[MinC].begin();
    pos = place[MinC][pos];
    //cout << MinC << "; " << place[MinC] << "; " <<  pos << "(" << str[pos] << ")" << endl;
    res += str[pos];


    while (pos != -1) {
      //cout << Ne << ", " << str[Ne] << "; " << endl;
      int tmp = pos;
      pos = ne[pos][str[pos] - 'a'];
      if (pos != -1) {
	res += str[pos];
      }
      else {
	bool used[26] = {false};
	for (int j = tmp + 1; j < str.size(); ++j) {
	  used[str[j] - 'a'] = true;
	}
	int k = 0;
	for (k = 0; k < 26; ++k) {
	  if (!used[k]) break;
	}
	res += (char)('a' + k);
      }
    }

    return res;
}


int main() {
    while (cin >> str) {
        for (int i = 0; i < 30; ++i) place[i].clear();
        cout << solve() << endl;
    }
}









Measured memory_bytes: 75140