To rotate labels I also had to reverse some regexps, which is a fun problem in itself. I wonder if there’s a general algorithm to do that.

Don’t worry, I tested the result and it’s still solvable