Updated production rules:
rule_12: A6 -> 2 A5 6 7
rule_16: A7 -> A4 3 8
rule_23: A13 -> 3 A7 A14