var Main = function (input) { var elements = input.split(""); console.log(String.fromCharCode(elements.map(function(item, i){ var num = elements[i].charCodeAt(0) - (i + 1); if (num < 65) { num = (num - 65) + 91; } return num; }))); };