I literally just went with the first low-cost solution that worked. No optimizations at all. The only thing I did was add some instructions at the end to make it take the L. Writing so many instructions in OM is not fun. I'm pretty sure min-cost is 80 because you need full access only to the inputs and outputs, but I'm sorry for those who had to program it. You know, as they say: "6 sets of fireworks a day keep the... uhhh... machine running at one cycle per minute".