Question
Vedika's Test
Vedika is given a string S, and an integer X, Her friend asks her to find the lexicographically largest string by removing no more than X characters from the string, Vedika has solved the problem can you also solve it?
Input
The first line of input contains a the string S.
The second and final line of input contains a single integer X.

Constraints
1 ≤ |S| ≤ 105
1 ≤ X ≤ 105
String only contains lowercase alphabets.
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.

Online