w = input() l = list(map(innt,input().split())) a = w[l[1]] w[l[1]] = w[0] w[0] = a print(w)