S=input() i,j=map(int,input().split()) if i>j:i,j=j,i print(S[:i],S[j],S[i+1:j],S[i],S[j+1:],sep="")