from functools import reduce
iterators = [iter(seq) for seq in sequences]
last = [next(iterator) for iterator in iterators]
indices = list(range(len(iterators) - 1))
while True:
    if reduce(operator.and_, [(l == last[0]) for l in last]):
        yield last[0]
last = [next(iterator) for iterator in iterators]
for i in indices:
    if last[i] < last[i + 1]:
        last[i] = next(iterators[i])
if last[i] > last[i + 1]:
    last[i + 1] = next(iterators[i + 1])
Присоединение к набору итераторов Python с упорядоченным целым числом