Explanation:
This task involves generating a sequence of closing brackets to match a given sequence of opening brackets. The challenge lies in accurately parsing the input to extract the opening brackets and then generating the correct sequence of closing brackets.

Analyzing the Task:
1. Parsing the Input: The input text must be parsed to extract the opening brackets. This requires identifying the opening brackets and their positions.

2. Generating the Closing Sequence: Once the opening brackets are identified, the closing sequence must be generated. This involves keeping track of the number of opening brackets and generating the correct number of closing brackets.

3. Ensuring Proper Parentheses: The generated sequence must be checked to ensure that the parentheses are properly balanced. This involves counting the number of opening and closing brackets and ensuring that they match.

Constructing the Code Prompt:
1. Parsing the Input: Extract the opening brackets from the input text. This can be done by iterating over the characters in the input string and identifying the opening brackets.

2. Generating the Closing Sequence: Initialize a list to store the closing brackets. Iterate over the opening brackets and generate the corresponding number of closing brackets.

3. [Important] Ensuring Proper Parentheses: Check the generated sequence to ensure that the parentheses are properly balanced. This involves counting the number of opening and closing brackets and ensuring that they match.

4. Returning the Final Answer: Output the generated sequence of closing brackets as the final answer.