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 31 terminals, ranging from 1 to 31.
Each terminal symbol occurs in the target sequence at least once.

There are 36 non-terminal symbols, ranging from A1 to A36.

Production rules:
rule_1: A1 -> A21 A17 A25 A2 A29 A33
rule_2: A2 -> A4 A5 A3
rule_3: A3 -> 1
rule_4: A4 -> A10 A11
rule_5: A5 -> 2
rule_6: A5 -> 3
rule_7: A5 -> A6 3
rule_8: A5 -> A10 2
rule_9: A6 -> 4
rule_10: A6 -> 5
rule_11: A6 -> A5
rule_12: A6 -> 6
rule_13: A6 -> A6
rule_14: A6 -> 7
rule_15: A6 -> A7 5
rule_16: A6 -> A9
rule_17: A7 -> A6 9
rule_18: A7 -> 8
rule_19: A7 -> A8 8
rule_20: A7 -> 9
rule_21: A8 -> A7 10
rule_22: A8 -> 10
rule_23: A9 -> A6 11
rule_24: A9 -> 11
rule_25: A10 -> A5 12
rule_26: A10 -> 12
rule_27: A11 -> 13
rule_28: A12 -> A13 15
rule_29: A12 -> 14
rule_30: A12 -> 15
rule_31: A12 -> A16 14
rule_32: A13 -> A12 16
rule_33: A13 -> A14 17
rule_34: A13 -> 16
rule_35: A13 -> 17
rule_36: A13 -> 18
rule_37: A14 -> A13
rule_38: A14 -> 19
rule_39: A15 -> A14 20
rule_40: A15 -> 20
rule_41: A16 -> A12 21
rule_42: A16 -> 21
rule_43: A17 -> A19 A16 A18
rule_44: A18 -> 22
rule_45: A19 -> A14 A20
rule_46: A20 -> 23
rule_47: A21 -> A23 A7 A22
rule_48: A22 -> 24
rule_49: A23 -> A9 A24
rule_50: A24 -> 25
rule_51: A25 -> A27 A6 A26
rule_52: A26 -> 26
rule_53: A27 -> A8 A28
rule_54: A28 -> 27
rule_55: A29 -> A31 A15 A30
rule_56: A30 -> 28
rule_57: A31 -> A14 A32
rule_58: A32 -> 29
rule_59: A33 -> A35 A9 A34
rule_60: A34 -> 30
rule_61: A35 -> A8 A36
rule_62: A36 -> 31

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