Version 2 - print new even-length arrays from two arrays
It's unclear to me why you didn't chose to use a tree. From your example you know:


A[0] has the children B[0:].
A[1] has the children B[1:].
A[2] has the children B[1:].
B[0] has the children A[2:].
B[1] has no children.
B[2] has no children.


From this you should be able to see that you'll just have to walk the tree to get the values.

To get all the values you walk the tree with the roots being all the values in A. And you filter odd results.

class Node:
    def __init__(self, value):
        self.value = value
        self.children = []

    def walk(self, path=None):
        path = (path or ()) + (self.value,)
        yield path
        for child in self.children:
            yield from child.walk(path)


def solution(A, B):
    A = [Node(a) for a in A]
    B = [Node(b) for b in B]

    for parents, children in ((A, B), (B, A)):
        for parent in parents:
            parent.children = [
                child
                for child in children
                if child.value &gt; parent.value
            ]

    for start in A:
        for values in start.walk():
            if len(values) % 2 == 0:
                print(values)