# Devon Lai
# Bergen County Academies
# Junior Division

file = open("jr-sample-input.txt", "r")
for x in file:
    x = x.strip().split()
    n = x[0]
    p = x[1]
    d = x[2]
    thespot = n[-int(p)]
    if thespot in "01234":
        newnum = int(thespot) + int(d)
        newnum = str(newnum)
        a = newnum[-1]
        n = str(n)
        n = list(n)
        n[-int(p)] = a
        if p == 1:
            front = n[:(-int(p))]
            back = n[(-int(p)):]
        else:
            front = n[:(-int(p)) + 1]
            back = n[(-int(p)) + 1:]
        length = len(back)
        for thing in range(0, length):
            back.append("0")
            del[back[0]]
        for x in front:
            print(x, end="")
        for x in back:
            print(x, end="")
        print()
    else:
        thespot = int(thespot) - int(d)
        thespot = abs(thespot)
        thespot = str(thespot)
        thespot = thespot[0]
        n = list(n)
        n[-int(p)] = thespot
        if p == "1":
            front = n[:(-int(p))]
            back = n[(-int(p)):]
        else:
            front = n[:(-int(p)) + 1]
            back = n[(-int(p)) + 1:]
        length = len(back)
        if p == "1":
            for x in front:
                print(x, end="")
            for x in back:
                print(x, end="")
        else:
            for thing in range(0, length):
                back.append("0")
                del [back[0]]
            for x in front:
                print(x, end="")
            for x in back:
                print(x, end="")
        print()