def incrementString(text="AAAA"):
    """Returns the text incremented by one letter

    The text must be alphabetic or a ValueError is raised.
    
    >>> incrementString("A")
    'B'
    >>> incrementString("Z")
    'AA'
    >>> incrementString("AM")
    'AN'
    >>> incrementString("AZ")
    'BA'
    >>> incrementString("BA")
    'BB'
    >>> incrementString("BZ")
    'CA'
    >>> incrementString("ZZA")
    'ZZB'
    >>> incrementString("ZZZ")
    'AAAA'
    >>> incrementString("AAAA")
    'AAAB'
    >>> incrementString("AAAZ")
    'AABA'
    >>> incrementString("ABC2")
    Traceback (most recent call last):
    ValueError: text must be purely alphabetic
    """
    if not text.isalpha():
        raise ValueError("text must be purely alphabetic")
    OrdA = ord("A")
    OrdZ = ord("Z")
    changed = False
    values = [ord(c) for c in reversed(text.upper())]
    for i in range(len(values)):
        if values[i] < OrdZ:
            values[i] += 1
            changed = True
            break
        elif values[i] == OrdZ:
            values[i] = OrdA
    if not changed:
        values = [OrdA] + values
    return "".join([chr(v) for v in reversed(values)])