Problem:
Score : 600 points

Problem Statement

A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters.
For example, arc, artistic and (an empty string) are all subsequences of artistic; abc and ci are not.

You are given a string A consisting of lowercase English letters.
Find the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.
If there are more than one such string, find the lexicographically smallest one among them.

Constraints

1 \leq |A| \leq 2 \times 10^5

A consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

A

Output

Print the lexicographically smallest string among the shortest strings consisting of lowercase English letters that are not subsequences of A.

Sample Input 1

atcoderregularcontest

Sample Output 1

b

The string atcoderregularcontest contains a as a subsequence, but not b.

Sample Input 2

abcdefghijklmnopqrstuvwxyz

Sample Output 2

aa

Sample Input 3

frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn

Sample Output 3

aca

Solution in Ruby (2.3.3) (judge verdict: Runtime Error)

S=gets.chomp.bytes
N=S.size
L=[nil]*(n+3)
l=[n]*26
(n-1).downto(0){|i|
	L[i]=l.dup
	l[S[i]-97]=i
}
L[-1]=l
q=[-1]
z={-1=>[nil,0]}
while !q.empty?&&q[0]!=n
	v=q.shift
	l=L[v]
	26.times{|c|
		if !z[l[c]]
			z[l[c]]=[v,c]
			q<<l[c]
		end
	}
end
r=''
while n
	n,c=z[n]
	r<<(c+97)
end
$><<r.reverse[1..-1]