Hey Socrates,
here is the Onefinity Wiring diagram that shows the necessary cable cross that Derek mentioned.
Note that stepper motor cables, just like all cables on a CNC machine, should be shielded.
If you want to make yourself longer stepper cables, this post lists what you need.