"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

function upperBound(ary,v,l,r){--l;for(var c;1<r-l;)ary[c=l+r>>1]<=v?l=c:r=c;return r;}

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var a = next(1), l = a.length, inf = 1e9;
  var map = [l], set = Array(26), cnt;
  for(var i = l; i > 25;){
    set.fill(0), cnt = 0;
    while(i--){
      var t = a[i].charCodeAt()-97;
      if(set[t])continue;
      if(cnt === 25){
        map.push(i);
        break;
      }
      cnt++;
      set[t] = 1;
    }
  }
  var b = xArray("[]",26);
  for(var i = 0; i < l; i++)b[a[i].charCodeAt()-97].push(i);
  for(var i = 0; i < 26; i++)b[i].push(inf);
  var ans = "", x = -1;
  for(var i = map.length; i--;){
    var v = map[i];
    for(var j = 0; j < 26; j++){
      var t = upperBound(b[j],x,0,b[j].length);
      t = b[j][t];
      if(v <= t){
        ans += String.fromCharCode(97+j);
        x = t;
        break;
      }
    }
  }
  return ans;
}