If you think of the on/off solenoids as LEDs, there's:
...but as written, your problem is simpler. It could be done with delays.