local s = io.read()
local n = #s
local cycle_end_pos = {}
local box = {}
for i = 1, 26 do
  box[i] = false
end
local t = {}
for i = 1, n do
  t[i] = s:sub(i, i):byte() - 96
end
local boxcnt = 0
for i = 1, n do
  local v = t[i]
  if not box[v] then
    box[v] = true
    boxcnt = boxcnt + 1
    if boxcnt == 26 then
      table.insert(cycle_end_pos, i)
      boxcnt = 0
      for j = 1, 26 do box[j] = false end
    end
  end
end
-- node = (#cycles + 1) * 26
local edge = {}
local invedge = {}
local canuse = {}

for i = 1, (#cycle_end_pos + 1) * 26 do
  edge[i] = {}
  invedge[i] = {}
  canuse[i] = false
end

local first_pos = {}
local last_pos = {}
for ic = 1, #cycle_end_pos do
  local spos = ic == 1 and 1 or cycle_end_pos[ic - 1] + 1
  local epos = cycle_end_pos[ic]
  for i = 1, 26 do
    box[i] = false
    first_pos[i] = 0
    last_pos[i] = 0
  end
  boxcnt = 0
  for i = spos, epos do
    local v = t[i]
    if first_pos[v] == 0 then
      first_pos[v] = i
    end
    last_pos[v] = i
  end
  for i = 1, 26 do
    local src = (ic - 1) * 26 + i
    for j = 1, 26 do
      if last_pos[j] <= first_pos[i] then
        local dst = ic * 26 + j
        table.insert(edge[src], dst)
        table.insert(invedge[dst], src)
      end
    end
  end
end
for i = 1, 26 do
  local idx = #cycle_end_pos * 26 + i
  canuse[idx] = true
end
if #cycle_end_pos == 0 then
  for i = 1, n do
    local v = t[i]
    local idx = #cycle_end_pos * 26 + v
    canuse[idx] = false
  end
else
  for i = cycle_end_pos[#cycle_end_pos] + 1, n do
    local v = t[i]
    local idx = #cycle_end_pos * 26 + v
    canuse[idx] = false
  end
end
local tasks = {}
for i = 1, 26 do
  local idx = #cycle_end_pos * 26 + i
  if canuse[idx] then
    table.insert(tasks, idx)
  end
end
local done = 0
while done < #tasks do
  done = done + 1
  local invsrc = tasks[done]
  for i = 1, #invedge[invsrc] do
    local invdst = invedge[invsrc][i]
    if not canuse[invdst] then
      canuse[invdst] = true
      table.insert(tasks, invdst)
    end
  end
end
local ret = {}
local curpos = 0
for i = 1, 26 do
  if canuse[i] then
    curpos = i
    table.insert(ret, string.char(96 + i))
    break
  end
end
for ic = 1, #cycle_end_pos do
  for i = 1, #edge[curpos] do
    local dst = edge[curpos][i]
    if canuse[dst] then
      curpos = dst
      table.insert(ret, string.char(96 + dst - 26 * ic))
      break
    end
  end
end
print(table.concat(ret))
