Олимпиадный тренинг

Задача 42975. long poster


Задача

Темы:
The young artist Vasya drew a poster with a very large number and decided to hang it on the longest wall of the school. Unfortunately, even the longest wall was not long enough, so he would have to shorten the poster to the desired length. Vasya — maximalist, so he wants the number obtained after all the edits to be as large as possible. Vasya needs to cut out any K numbers from the poster, but he will never agree to rearrange the resulting pieces in places, as this will upset the color balance of the poster. Help Vasya remake the poster.

Input
The first line of the input contains an integer N, written on the original long poster. It is guaranteed that N has at least two and no more than 200,000 digits (10 ≤ N < 10200,000).
The second line contains an integer K — the number of numbers to cut from the poster. It is guaranteed that K is at least one and strictly less than the number of digits of N (1 ≤ K, 10K ≤ N).
Imprint
Output the maximum number that can appear on the poster after it has been shortened
Examples
# Input Output
1 2023
1
223

Remark
In the example from the condition on the poster, the number 2023 is written, one digit must be cut out of it.
The maximum number that can be obtained with this is 223.