x y z a b c d e f train0 train1 train2 train3 x 0 x a b x x y z a b c d e f gate0 gate1 gate2 gate3 y 0 y c d y y 0 y c d y x y z a b c d e f controller0 controller1 controller2 controller3 z 0 z e f z z 0 z e f z