random.shuffle(l)
out = []
prev_i = -1
while any(a for a in l):
    new_i = max(((i, a) for i, a in enumerate(l) if i != prev_i), key=lambda
        x: len(x[1]))[0]
out.append(l[new_i].pop(random.randint(0, len(l[new_i]) - 1)))
prev_i = new_i
print(out)
Specific shuffling list in Python