Processing two Assemblies in one process.

This sample works, but not correctly.
Problem 01.vcmx (190.8 KB)
It only works if the order of the incoming details is correct.
Take turns pallet 1 and pallet 2
In fact, this order is constantly changing.
However, the finished bases still come in turn with pallet 1 and pallet 2, which is not correct.
If assembly 1 goes to the line then it must definitely come out with assembly 1 and the same assembly 2.
Regardless of the order of the pallets.