{"trustable":false,"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":"羊羊们到了谈婚论嫁的年龄了,雷巨巨有的忙了。他有四种羊,每种羊分公母且公母才能配对,为方便输入用[]\u003c\u003e(){}代替四种羊,一天他让一些羊羊站成一排开始配对,有如下定义:假设s1和s2是满足配对的,则\u003cs1\u003es2,{s1}s2,[s1]s2,(s1)s2也是满足配对的,如\"[[(){}]\u003c\u003e]\"和\"{[(\u003c\u003e)]}\"是满足配对的,而\"\u003c)()\"和\"]\u003e\u003c[\"是不满足的,雷巨巨可以选择让其中一种羊变成另一种羊但无法改变其性别,如\u0027\u003c\u0027可以变成\u0027(\u0027,\u0027{\u0027,\u0027[\u0027但不可变成\u0027)\u0027,\u0027}\u0027,\u0027]\u0027。问至少改变几次才能让羊羊们都找到幸福。"}},{"title":"Input","value":{"format":"HTML","content":"输入一行字符串,仅由四种括号组成,长度不超过1e6"}},{"title":"Output","value":{"format":"HTML","content":"如果不能使所有羊羊配对,则打印\"Impossible\",否则,打印最少替换的次数"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e[\u0026lt;}){}\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e2\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e{()}[]\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e0\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e]]\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003eImpossible\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}