Notice that the motor connectors contain metal within and on the outside knobs of a 2x2 brick. You can change the polarity of the wires by rearranging the connections on the RCX ports. For example, if your computer program directs the RCX to spin your robot's motors forward but, they actually spin in reverse or in opposite directions, you simply need to adjust the wire orientation. Your computer program will determine where you place your sensors. The LEGO light sensor has its own connector wire.
Touch sensors require a motor connection wire.