//Loren Troan
//ACSL Contest #1
//Cary Academy INT-3

def run(input):
              input = input.split('\n')
              out = []
              for x in input:
                             out.append(numbertransformation(x))
              return out


def numbertransformation(input):
              input = input.split('  ')
              addnumber = int(input[0][0-int(input[1])])
              outnum = ''
              for x in range(0, len(input[0])-int(input[1])):
                             outnum += str( (addnumber+int(input[0][x])  )%10 )
              outnum += str(addnumber)
              for x in range(len(input[0])-int(input[1])+1, len(input[0])):
                             outnum += str(abs( int(input[0][x])-addnumber   ))
              return outnum

inputfile = open('2020int1.txt', 'r')
input = inputfile.read()
inputfile.close()

out = run(input)
for line in out:
    print(line)