function Main (input) { var lineLength = input.length; var line = input.split("") rapt(line,lineLength); } function rapt(line,lineLength){ var afterLine; for (var i= 0; i<= lineLength -1; i++) if (line[i].charCodeAt() >=65 && line[i].charCodeAt() <= 90){ line[i] = line[i].toLowerCase(); } else { line[i] = line[i].toUpperCase(); }; afterLine = line.join("") console.log(afterLine) } Main(require("fs").readFileSync("/dev/stdin", "utf8"));