const lines = require('fs') .readFileSync('/dev/stdin', 'utf-8') .trim().split('\n').values(); let S = lines.next().value; const [i, j] = lines.next().value.split(' '); S = S.split(/\B/); [S[i], S[j]] = [S[j], S[i]]; console.log(S.join(''));