import strutils, sequtils let S = readLine stdin ij = map(split readLine stdin, parseInt) (i, j) = (ij[0], ij[1]) var T = "" for n, s in S: if n == i or n == j: add T, S[i + j - n] else: add T, S[n] echo T