local function magic(n) local s = '' for i = 0, 6 do local j = math.floor(n / (26^i) % 26) s = string.char(j + 65) .. s end return s end for i = 0, 26^7 - 1 do print(magic(i)) end