def next_gene_index() -> int:
    if (len(attempted_genes) == candidate_length):
        return (- 1)
    i = None
    condition = False
    while (not condition):
        i = random.randint(seglength, (n - seglength))
        if (i not in attempted_genes):
            condition = True
    assert (i is not None)
    assert (seglength <= i <= (n - seglength))
    attempted_genes.add(i)
    return i
def next_gene_index() -> int:
    if (len(attempted_genes) == candidate_length):
        return (- 1)
    i = None
    condition = False
    while (not condition):
        i = random.randint(seglength, (n - seglength))
        if (i not in attempted_genes):
            condition = True
    assert (i is not None)
    assert (seglength <= i <= (n - seglength))
    attempted_genes.add(i)
    return i