human
Write me a Python code to find the shortest string among the strings consisting of lowercase English letters that are not subsequences of A given the following:
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.

Examples

Input

atcoderregularcontest

Output

b

Input

abcdefghijklmnopqrstuvwxyz

Output

aa

Input

frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn

Output

aca
Using java can you solve the prior task?
assistant
#Here is Python code to find the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.

import java.util.*;

public class Main {
    public void main(Scanner sc) {
        char a[] = sc.next().toCharArray();
        int len = a.length;

        Map<Character, TreeSet<Integer>> map = new HashMap<>();
        for (int i = 0; i < len; i++) {
            map.putIfAbsent(a[i], new TreeSet<>());
            map.get(a[i]).add(i + 1);
        }

        int data[] = new int[len + 1];
        BitSet bset = new BitSet();
        data[len] = 0;
        for (int i = len - 1; i >= 0; i--) {
            bset.set(a[i] - 'a');
            data[i] = data[i + 1];
            if (bset.cardinality() == 26) {
                bset.clear();
                data[i]++;
            }
        }

        int p = 0;
        int ansLen = data[0] + 1;
        char ans[] = new char[ansLen];
        for (int i = 0; i < ansLen; i++) {
            for (char c = 'a'; c <= 'z'; c++) {
                if (!map.containsKey(c)) {
                    ans[i] = c;
                    p = len + 1;
                    break;
                } else {
                    Integer next = map.get(c).higher(p);
                    if (next == null || (data[p] - data[next] == 1)) {
                        ans[i] = c;
                        p = getOrDefault(next, len + 1);
                        break;
                    }
                }
            }
        }

        System.out.println(new String(ans));
    }

    private int getOrDefault(Integer n, int def) {
        return n == null ? def : n;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
}