According to Jiugongge
123
456
789
So you can connect the wires in sequence.
369 is 1, 321456987,5, 14789654 is 6, and finally 123654789 is 2.