Connecting wires on a Lionel SD-40 diesel dual motor engine??

I was replacing the shell on my SD-40 dual motor diesel and two of the yellow wire nuts fell off and the wires unraveled. Now I cant tell which wires go together. Do the same color wires from both motors get connected together? I’m reluctant to just try combinations on a trial and error basis. Can someone help?