I have a context free grammar (CFG). The initial symbol is `A1`. The terminal symbols are just integers and the non-terminal symbols start with `A`. I also have a target sequence of terminal symbols which needs to be produced by the grammar. However, the CFG production rules have had some terminal symbols removed which may now render it impossible to produce the target sequence. Please attempt to repair the CFG so that the sequence can be produced. The only operations which can be made to repair the CFG are the insertion of terminal symbols anywhere in existing production rules. Deleting or reordering symbols in existing production rules and creating new production rules is prohibited. Please try minimize the total number of terminal symbols inserted into the production rules so that the CFG can produce the target sequence. Reason about the problem however you wish and write out whatever working out you want. When you are finished please write a new line with `Updated production rules:`, and then write a new line for each of the updated production rules (including `rule_<n>:`), no need to rewrite the production rules which haven't changed. Do not write anything after the updated production rules.


"""
There are 29 terminals, ranging from 1 to 29.
Each terminal symbol occurs in the target sequence at least once.

There are 32 non-terminal symbols, ranging from A1 to A32.

Production rules:
rule_1: A1 -> A2
rule_2: A2 -> A32
rule_3: A3 -> 6 A4
rule_4: A4 -> 1
rule_5: A4 -> 2
rule_6: A4 -> 7
rule_7: A5 -> A6 A7
rule_8: A6 -> 8
rule_9: A7 -> 3 A9
rule_10: A7 -> 4 A8
rule_11: A8 -> 1
rule_12: A8 -> 2
rule_13: A9 -> 1
rule_14: A9 -> 2
rule_15: A10 -> A11 A12
rule_16: A11 -> 9
rule_17: A12 -> 3 A14
rule_18: A12 -> 4 A13
rule_19: A13 -> 1
rule_20: A13 -> 2
rule_21: A13 -> 10
rule_22: A14 -> 1
rule_23: A14 -> 2
rule_24: A15 -> A16 A17
rule_25: A16 -> 12
rule_26: A17 -> 11 A18
rule_27: A18 -> 1
rule_28: A18 -> 2
rule_29: A19 -> 13
rule_30: A20 -> A21 A3
rule_31: A21 -> 14
rule_32: A22 -> 15
rule_33: A23 -> 16 A24
rule_34: A24 -> 5
rule_35: A25 -> A26 A23 A15 A22
rule_36: A26 -> 17 A19
rule_37: A27 -> 18 A20
rule_38: A28 -> 20 A25
rule_39: A29 -> 25
rule_40: A29 -> A30 A28 A10 A27
rule_41: A30 -> 26 A5
rule_42: A31 -> A29 24 23 A29 28 22
rule_43: A32 -> 29 A31 27

Target sequence:
29 26 8 3 1 20 17 13 16 5 12 11 2 15 21 9 4 10 18 14 6 7 19 24 23 25 28 22 27
"""