import random


def random_index(seed, N):
    """ Args: seed - initial index, N - maximum index
        Return: A random index between [0, N] except for seed
    """
    offset = random.randint(1, N-1)
    idx = (seed + offset) % N 
    assert(seed != idx)
    return idx