{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA string is called \u003cspan class\u003d\"tex-font-style-it\"\u003ebracket sequence\u003c/span\u003e if it does not contain any characters other than \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e(\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e)\u003c/span\u003e\". A bracket sequence is called \u003cspan class\u003d\"tex-font-style-it\"\u003eregular\u003c/span\u003e (shortly, RBS) if it is possible to obtain correct arithmetic expression by inserting characters \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e+\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e1\u003c/span\u003e\" into this sequence. For example, \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e(())\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e()()\u003c/span\u003e\" are RBS and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e)(\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e(()\u003c/span\u003e\" are not.\u003c/p\u003e\u003cp\u003eWe can see that each opening bracket in RBS is paired with some closing bracket, and, using this fact, we can define \u003cspan class\u003d\"tex-font-style-bf\"\u003enesting depth\u003c/span\u003e of the RBS as maximum number of bracket pairs, such that the $$$2$$$-nd pair lies inside the $$$1$$$-st one, the $$$3$$$-rd one — inside the $$$2$$$-nd one and so on. For example, nesting depth of \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u003c/span\u003e\" is $$$0$$$, \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e()()()\u003c/span\u003e\" is $$$1$$$ and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e()((())())\u003c/span\u003e\" is $$$3$$$.\u003c/p\u003e\u003cp\u003eNow, you are given RBS $$$s$$$ of even length $$$n$$$. You should color each bracket of $$$s$$$ into one of two colors: red or blue. Bracket sequence $$$r$$$, consisting only of red brackets, should be RBS, and bracket sequence, consisting only of blue brackets $$$b$$$, should be RBS. Any of them can be empty. You are not allowed to reorder characters in $$$s$$$, $$$r$$$ or $$$b$$$. No brackets can be left uncolored.\u003c/p\u003e\u003cp\u003eAmong all possible variants you should choose one that \u003cspan class\u003d\"tex-font-style-bf\"\u003eminimizes maximum\u003c/span\u003e of $$$r$$$\u0027s and $$$b$$$\u0027s nesting depth. If there are multiple solutions you can print any of them.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains an even integer $$$n$$$ ($$$2 \\le n \\le 2 \\cdot 10^5$$$) — the length of RBS $$$s$$$.\u003c/p\u003e\u003cp\u003eThe second line contains regular bracket sequence $$$s$$$ ($$$|s| \u003d n$$$, $$$s_i \\in \\{$$$\"\u003cspan class\u003d\"tex-font-style-tt\"\u003e(\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e)\u003c/span\u003e\"$$$\\}$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint single string $$$t$$$ of length $$$n$$$ consisting of \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e0\u003c/span\u003e\"-s and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e1\u003c/span\u003e\"-s. If $$$t_i$$$ is equal to \u003cspan class\u003d\"tex-font-style-tt\"\u003e0\u003c/span\u003e then character $$$s_i$$$ belongs to RBS $$$r$$$, otherwise $$$s_i$$$ belongs to $$$b$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n()\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e11\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n(())\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0101\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e10\n((()())())\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0110001111\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example one of optimal solutions is $$$s \u003d $$$ \"$$$\\color{blue}{()}$$$\". $$$r$$$ is empty and $$$b \u003d $$$ \"$$$()$$$\". The answer is $$$\\max(0, 1) \u003d 1$$$.\u003c/p\u003e\u003cp\u003eIn the second example it\u0027s optimal to make $$$s \u003d $$$ \"$$$\\color{red}{(}\\color{blue}{(}\\color{red}{)}\\color{blue}{)}$$$\". $$$r \u003d b \u003d $$$ \"$$$()$$$\" and the answer is $$$1$$$.\u003c/p\u003e\u003cp\u003eIn the third example we can make $$$s \u003d $$$ \"$$$\\color{red}{(}\\color{blue}{((}\\color{red}{)()}\\color{blue}{)())}$$$\". $$$r \u003d $$$ \"$$$()()$$$\" and $$$b \u003d $$$ \"$$$(()())$$$\" and the answer is $$$2$$$.\u003c/p\u003e"}}]}