here's my solution! i thought about stable loops, but decided it would be a headache and might require too many of the 18 available doors. I found the trick was using some of the less important colors to temporarily store useful values - negative one, negative ten, and negative fourteen specifically. note that this doesnt work if you have a different amount of stone keys than 14 . the order is fucked up, don't ask me about the order xD