def shortenLists(maxLength, *input_lists):
    new_lists = [list(l) for l in input_lists]
overflows = [[] for n in input_lists]
for index, l in enumerate(new_lists):
    overflows[index] = new_lists[index][maxLength:]
new_lists[index] = new_lists[index][:maxLength]
overflows[index].reverse()
while sum(len(l) for l in new_lists) > maxLength:
    index = max(enumerate(new_lists), key=lambda tup: len(tup[1]))[0]
overflows[index].append(new_lists[index].pop())
[o.reverse() for o in overflows]
return zip(new_lists, overflows)
Сократите количество списков на основе общей максимальной длины, перемещая лишнее в новые списки.