import math
import string


def alphabet_enumeration(length):
    """
    Return list of letters : A, B, ... Z, AA, AB, ...
    See mapentity/leaflet.enumeration.js
    """
    if length == 0:
        return []
    if length == 1:
        return ["A"]
    width = int(math.ceil(math.log(length, 26)))
    enums = []
    alphabet = string.ascii_uppercase
    for i in range(length):
        enum = ""
        for j in range(width):
            enum = alphabet[i % 26] + enum
            i = i // 26
        enums.append(enum)
    return enums