AtCoder Regular Contest 081
E
Don't Be a Subsequence
AtCoder
⌀ 2072
原题
←F →
翻译中…

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$.

翻译中…

样例

Input #1
atcoderregularcontest
Output #1
b
The string `atcoderregularcontest` contains `a` as a subsequence, but not `b`.
Input #2
abcdefghijklmnopqrstuvwxyz
Output #2
aa
Input #3
frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn
Output #3
aca
题目信息
题号
arc081_c
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。