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