The code is rather convoluted.
You can also get stuck in certain endings I think,
The order if I remember right was something like:
Cool concept but not so great execution. There were really only two parts I believe where you needed to swap girls to solve a puzzle, it could have been used more often. To unlock the door for the gun girl, and that the gun girl was the only one that could input the code because knife girl is afraid of ropes apparently.