local n = io.read("*n") local function getalpha(val) return string.char(65 + val) end local digit = 1 local diglim = 26 while(diglim <= n) do digit = digit + 1 n = n - diglim diglim = diglim * 26 end local ret = {} for i = 1, digit do local lowdig = n % 26 table.insert(ret, 1, getalpha(lowdig)) n = math.floor(n / 26) end print(table.concat(ret))