def nextpostfix(x):
    """Returns the next alpha postfix in the sequence."""
    if x == '':
        return 'a'

    if ord(x[-1]) < ord('z'):
        x = x[0:-1] + chr(ord(x[-1])+1)
    else:
        if x[0] == 'z':
            x = 'a' + 'a' * len(x)
        else:
            x = chr(ord(x[0])+1) + x[1:]
            x = x[0:-1] + 'a'
    return x