You step on a piece of glass and immediately pull your foot away.What are the neural pathways that are taken?

You step on a piece of glass and immediately pull your foot away

What are the neural pathways that are taken? (pain, pull foot away)

which parts of the brain and spinal cord is the signal going through? Where is it synapsing