def increment(string):
    """
    Increments a string of letters e.g. aaa -> aab, aza -> baa, ...
    """
    letters = list('abcdefghijklmnopqrstuvwxyz')
    if string[-1] != 'z':
        chars = [char for char in string]
        chars[-1] = letters[letters.index(chars[-1]) + 1]
        return(''.join(chars))
    else:
        return(increment(string[:-1]) + 'a')