14182 - Dad, don't do that   

Description

"Dad, don't do that"

Your dad cares about your friendship status. So, he decided to log into your social media to see who you were chatting with. Due to security issues, your password has been encrypted by adding extra K digits. Unfortunately, the original password is the smallest solution after removing K digits from the encrypted password.(e.g., for 1432219, if k = 3, the solution will be 1219)

Thus, it is easy for him to get the original password.

Although you felt sad, you were still curious about how he did it. So, you decide to write a program to do the same thing as your dad.

 

Note that, if there is a leading 0 after removing K digits, it is still legal, but you don't have to print the leading 0s.

For example, for 10200, if k = 1, the minimum result is 0200, where you should print "200".

 

Hint: You can use the concept of "stack", and push or pop each digit according to the top element of the stack.

Input

The first line is a sequence of digits, the length will be less than 1000001.

The second line is an integer K, which is the number of digits that will be removed. K will be less than 500001.

Output

The minimum integer after removing K digits and you should print a new line character in the end.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss