program dont_be_a_subsequence
  implicit none
  character(200000) :: a, s
  integer :: n, dp(0:200000,26), i, j, m, k, l
  dp = 0
  read(*,*) a
  a = trim(adjustl(a))
  n = len_trim(a)
  do i = n, 1, -1
    m = 1
    do j = 1, 26
      if (dp(i,j).lt.dp(i,m)) m = j
    end do
    do j = 1, 26
      dp(i-1,j) = dp(i,j)
    end do
    k = ichar(a(i:i))-96
    dp(i-1,k) = dp(i,m)+1
  end do
  k = dp(0,1)
  m = 1
  do i = 1, 26
    if (dp(0,i).lt.k) then
      k = dp(0,i)
      m = i
    end if
  end do
  j = 1
  s = ""
  do i = 1, k+1
    do while (j.le.n.and.m.ne.ichar(a(j:j))-96)
      j = j+1
    end do
    if (j.gt.n) exit
    do l = 1, 26
      if (dp(j-1,m).eq.dp(j,l)+1) then
        s = trim(adjustl(s))//achar(m+96)
        m = l
        exit
      end if
    end do
    j = j+1
  end do
  s = trim(adjustl(s))//achar(m+96)
  write(*,'(a)') trim(adjustl(s))
  stop
end program dont_be_a_subsequence