Rearrange the train wagons so you get only trains of the same wagons. You can only connect the same wagons.