i,j=map(int,input().split) S=list(map(int,input().split())) a,b=S[i],S[j] S[i],S[j]=b,a print("".join(S))