n = input() c = list(map(int,input().split())) print(n.replace(n[c[0]], '@').replace(n[c[1]], n[c[0]]).replace('@', n[c[1]]))