# your code goes here
from itertools import product
def mix(first,second):
	if not (bool(first) and bool(second)):
		return first+second
	el = next(product(first,second))
	if el[0] == el[1]:
		del first[first.index(el[0])], second[second.index(el[0])]
	return mix(first,second)
	

x = mix([1,1,1,1],[1,1])
print(x)