$Harshad$ $Mehta$ is planning  a new scam with the stocks he is given a stock of  integer price S and a number K . $harshad$ has got the power to change the number $S$ at most $K$ times
In order to raise the price of stock and now cash it for his benefits
Find the largest price at which $harshad$ can sell the stock in order to maximize his profit 
-----Input:-----
- First line will contain $S$ and  $K$ , the price of the stock and the number K 
-----Output:-----
Print the largest profit  he can make in a single line.
-----Constraints-----
- S can take value upto 10^18
NOTE: use 64 int number to fit range
- K can take value from [0.. 9]
-----Sample Input:-----
4483 2
-----Sample Output:-----
9983
-----EXPLANATION:-----
First two digits of the number are changed to get the required number.
# # cook your dish here
# n,k=map(int,input().split())
# x=[int(y) for y in str(n)]
# if k<=len(x):
#     for i in range(k):
#         x[i]=9
# else:
#     k=len(x)
#     for i in range(k):
#         x[i]=9
# c="".join(str(x)for x in x)
# print(c)
# print(max(int(c),n*k))
n,k=list(map(int,input().split()))
# x=[int(y) for y in str(n)]
x=str(n)
a=[]
# if k<=len(x):
#     for i in range(k):
#         x[i]=9
# else:
#     k=len(x)
#     for i in range(k):
#         x[i]=9
# print("".join(str(x)for x in x))
for i in range(len(x)):
    if k<1:
        break
    if x[i]!='9':
        x=x[0:i]+'9'+x[i+1:]

        k-=1
print(x)

# # cook your dish here
# n,k=map(int,input().split())
# x=[int(y) for y in str(n)]
# if k<=len(x):
#     for i in range(k):
#         x[i]=9
# else:
#     k=len(x)
#     for i in range(k):
#         x[i]=9
# c="".join(str(x)for x in x)
# print(c)
# print(max(int(c),n*k))
n,k=list(map(int,input().split()))
# x=[int(y) for y in str(n)]
x=str(n)
a=[]
# if k<=len(x):
#     for i in range(k):
#         x[i]=9
# else:
#     k=len(x)
#     for i in range(k):
#         x[i]=9
# print("".join(str(x)for x in x))
for i in range(len(x)):
    if k<1:
        break
    if x[i]!='9':
        x=x[0:i]+'9'+x[i+1:]

        k-=1
print(x)
