function ctos(c) { return String.fromCharCode(c) } function test(n) { var result = [] do { result.push((n % 26) + 65); n = (n / 26) - 1; } while (n >= 0); return result .reverse() .map(ctos) .join("") } function Main(input) { var input = input.split('\n')[0]; var N = parseInt(input) console.log(N, test(N)) } Main(require("fs").readFileSync("/dev/stdin", "utf8"));