a=list(input()) b=list(map(int,input().split())) print(b[1]) c=a[b[0]] a[b[0]]=a[b[1]] a[b[1]]=c print("".join(a),end="")