function Main(input) { input = input.split("\n"); const s = input[0]; const al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); let res = ""; for (let i = 0; i < s.length; ++i) { let idx = al.indexOf(s[i]); idx -= i + 1; idx %= 26; if (idx < 0) idx += 26; res += al[idx]; } console.log(res); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));