Subsequence
Given a string , your task is to find the shortest string that is not a subsequence of . If there are multiple such strings, choose the lexicographically smallest one. You can earn partial credit by outputting a string of the minimum length.
Recall that a string is a subsequence of a string if can be derived from by deleting some (possibly none or all) characters.
A string is considered lexicographically smaller than a string if one of the following conditions holds:
is a prefix of , but ;
At the first position where and differ, the character in precedes the character in in the alphabet.
Input
The first line contains the string ().
Output
Output the required string.
Examples
Note
Note that all possible characters are present in the string, and the string starts and ends with "a".
Since all possible characters are present, the answer cannot be of length . Given that after the first letter "a", all other letters are present, it is evident that the first character of the answer must be at least "b". There is a substring "ba", but not "bb", so the answer is "bb".
If this test were scored, you would receive points for outputting "bb". If you output any other string of length (for example, "aa", "ba", "zz"), you would receive point.
Scoring
This problem consists of tests, each worth points. If you provide the correct answer for a test, you will earn points for it.
If the string you output has the same length as the correct answer, you will receive point for it. This string must consist only of lowercase English letters. Note that there are no other requirements for this string. You can even output a string that is a subsequence of , as long as its length matches the answer.