Question
String Peak
Alice is given a string S and an integer X. Her task is to find the lexicographically largest string possible by deleting at most X characters from S. Can you help Alice solve this challenge?
Input
The first line of input contains a the string S.
The second and final line of input contains a single integer X.
The second and final line of input contains a single integer X.
Output
Print the lexicographically largest string possible after removing not more than X characters.
Example
Sample Input
abzccd
4
Sample Output
zd
Explanation
The first two characters and two characters after 'z' can be removed to get string "zd". It can be observed that no lexicographically larger string can be formed.
abzccd
4
Sample Output
zd
Explanation
The first two characters and two characters after 'z' can be removed to get string "zd". It can be observed that no lexicographically larger string can be formed.