def increment(input):
    """
    >>> increment("a")
    'b'
    >>> increment("abc")
    'abd'
    >>> increment("asd")
    'ase'
    >>> increment("zzz")
    'aaaa'
    """
    result = ""
    carry = False

    for i in range(len(input)-1, -1, -1):
        if input[i] == "z":
            result = "a" + result
            carry = True
        else:
            result = input[:i] + chr(ord(input[i]) + 1) + result
            carry = False
            break

    if carry:
        return "a" + result
    else:
        return result