$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.

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
(a, b) = [int(_) for _ in input().split()]
if b == 0:
	print(a)
else:
	l = []
	a = str(a)
	for i in range(len(a)):
		l.append(a[i])
	for i in range(len(l)):
		if b == 0:
			break
		if l[i] == '9':
			continue
		else:
			l[i] = '9'
			b -= 1
	s = ''
	for i in l:
		s += i
	print(s)


def maxnum(s, k):
	l = len(s)
	if l == 0 or k == 0:
		return s
	if l == 1:
		return '9'
	if s[0] != '9':
		s = '9' + s[1:]
		k -= 1
	i = 1
	while k > 0 and i < l:
		if s[i] != '9':
			s = s[:i] + '9' + s[i + 1:]
			k -= 1
		i += 1
	return s
(n, k) = list(map(int, input().split()))
s = f'{n}'
print(maxnum(s, k))


(n, k) = input().split()
a = [int(i) for i in n]
k = int(k)
i = 0
n = len(a)
while k > 0 and i < n:
	if a[i] != 9:
		a[i] = 9
		k -= 1
	i += 1
print(''.join(map(str, a)))


(s, k) = map(int, input().split())
a = str(s)
l = [int(d) for d in str(a)]
while k > 0:
	for j in range(len(l)):
		if l[j] == 9:
			continue
		else:
			l[j] = 9
			k -= 1
		if k < 1:
			break
print(*l, sep='')


(st, k) = input().split()
st = list(st)
k = int(k)
for i in range(len(st)):
	if k < 1:
		break
	if st[i] != '9':
		st[i] = '9'
		k -= 1
print(''.join(st))


(st, k) = input().split()
k = int(k)
for i in range(len(st)):
	if k < 1:
		break
	if st[i] != '9':
		st = st[0:i] + '9' + st[i + 1:]
		k -= 1
print(st)


(num, k) = input().split()
k = int(k)
l = []
old = ''
for x in range(len(num)):
	if num[x] != '9' and k > 0:
		old = '9'
		l.append(old)
		k = k - 1
	else:
		l.append(num[x])
for x in l:
	print(x, end='')


(N, K) = input().split()
(N, K) = (list(N), int(K))
for i in range(len(N)):
	if K and N[i] != '9':
		N[i] = '9'
		K -= 1
print(''.join(N))


(s, k) = list(map(int, input().split()))
strS = str(s)
res = ''
for i in range(0, len(strS)):
	if k > 0 and strS[i] != '9':
		res += '9'
		k -= 1
	else:
		res += strS[i]
print(int(res))


(s, k) = map(int, input().split())
i = 0
c = 0
st = list(str(s))
while i < k:
	if i >= len(st):
		break
	if st[i] != '9':
		st[i] = '9'
		c = c + 1
	i = i + 1
if c < k:
	for i in range(len(st)):
		if c >= k:
			break
		if st[i] != '9':
			st[i] = '9'
			c = c + 1
st = ''.join(st)
s = int(st)
print(s)


(n, k) = map(int, input().split())
n = str(n)
for i in range(len(n)):
	if k == 0:
		break
	if n[i] != '9':
		n = n[:i] + '9' + n[i + 1:]
		k -= 1
print(n)


(n, k) = list(map(int, input().split()))
n = str(n)
l = list(n)
n = len(l)
for i in range(n):
	if k > 0:
		if l[i] != '9':
			l[i] = '9'
			k -= 1
print(''.join(l))


def findMaximumNum(st, n, k):
	for i in range(n):
		if k < 1:
			break
		if st[i] != '9':
			st = st[0:i] + '9' + st[i + 1:]
			k -= 1
	return st
(s, k) = list(map(int, input().split()))
st = str(s)
n = len(st)
print(findMaximumNum(st, n, k))


def findMaximumNum(st, k):
	for i in range(len(st)):
		if k < 1:
			break
		if st[i] != '9':
			st = st[0:i] + '9' + st[i + 1:]
			k -= 1
	return st
(st, m) = input().split()
k = int(m)
print(findMaximumNum(st, k))


try:
	(s, k) = map(int, input().split())
	num = str(s)
	l = []
	for i in range(len(num)):
		l.append(int(num[i]))
	cnt = 0
	for i in range(len(l)):
		if k == 0:
			break
		if l[i] != 9:
			l[i] = 9
			cnt += 1
		if cnt == k:
			break
	for i in l:
		print(i, end='')
	print()
except EOFError as e:
	pass


(x, y) = list(map(str, input().split(' ')))
l = list(x)
y = int(y)
i = 0
while i < int(y):
	if l[i] != '9':
		l[i] = '9'
	else:
		y += 1
	i += 1
print(''.join(l))


(n, k) = input().split()
k = int(k)
l = len(n)
ans = ''
for i in range(l):
	if k == 0:
		break
	if n[i] != '9':
		ans += '9'
		k -= 1
	else:
		ans += n[i]
if len(ans) == l:
	print(ans)
else:
	for j in range(len(ans), l):
		ans += n[j]
	print(ans)


(n, k) = input().split()
k = int(k)
res = [x for x in str(n)]
i = 0
while k > 0 and i < len(res):
	if res[i] != '9':
		res[i] = '9'
		k = k - 1
		i = i + 1
	else:
		i = i + 1
st = ''
x = st.join(res)
print(x)


(n, k) = map(int, input().split())
x = str(n)
j = 0
v = []
for i in range(0, len(x)):
	if x[i] == '9':
		v.append(x[i])
		continue
	elif j < k:
		j = j + 1
		v.append('9')
	else:
		v.append(x[i])
print(''.join(v))


(s, k) = [int(s) for s in input().split(' ')]
a = str(s)
ans = ''
for ch in a:
	if k > 0:
		if int(ch) < 9:
			ans += '9'
			k -= 1
		else:
			ans += ch
	else:
		ans += ch
print(ans)