{"problem":{"name":"Mismatched Parentheses","description":{"content":"You are given a string $S$ of length $N$ consisting of lowercase English letters and the characters `(` and `)`.   Print the string $S$ after performing the following operation as many times as possib","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc307_d"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$ consisting of lowercase English letters and the characters `(` and `)`.  \nPrint the string $S$ after performing the following operation as many times as possible.\n\n*   Choose and delete a contiguous substring of $S$ that starts with `(`, ends with `)`, and does not contain `(` or `)` other than the first and last characters.\n\nIt can be proved that the string $S$ after performing the operation as many times as possible is uniquely determined without depending on how it is performed.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $N$ is an integer.\n*   $S$ is a string of length $N$ consisting of lowercase English letters and the characters `(` and `)`.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc307_d","tags":[],"sample_group":[["8\na(b(d))c","ac\n\nHere is one possible procedure, after which $S$ will be `ac`.\n\n*   Delete the substring `(d)` formed by the fourth to sixth characters of $S$, making it `a(b)c`.\n*   Delete the substring `(b)` formed by the second to fourth characters of $S$, making it `ac`.\n*   The operation can no longer be performed."],["5\na(b)(","a("],["2\n()","The string $S$ after the procedure may be empty."],["6\n)))(((",")))((("]],"created_at":"2026-03-03 11:01:14"}}