{"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\u003eIn the \u003cspan class\u003d\"tex-font-style-tt\"\u003e$$$2022$$$\u003c/span\u003e year, Mike found two binary integers $$$a$$$ and $$$b$$$ of length $$$n$$$ (both of them are written only by digits $$$0$$$ and $$$1$$$) that can have leading zeroes. In order not to forget them, he wanted to construct integer $$$d$$$ in the following way: \u003c/p\u003e\u003cul\u003e \u003cli\u003e he creates an integer $$$c$$$ as a result of bitwise summing of $$$a$$$ and $$$b$$$ \u003cspan class\u003d\"tex-font-style-it\"\u003ewithout transferring carry\u003c/span\u003e, so $$$c$$$ may have one or more $$$2$$$-s. For example, the result of bitwise summing of $$$0110$$$ and $$$1101$$$ is $$$1211$$$ or the sum of $$$011000$$$ and $$$011000$$$ is $$$022000$$$; \u003c/li\u003e\u003cli\u003e after that Mike replaces equal consecutive digits in $$$c$$$ by one digit, thus getting $$$d$$$. In the cases above after this operation, $$$1211$$$ becomes $$$121$$$ and $$$022000$$$ becomes $$$020$$$ (so, $$$d$$$ won\u0027t have equal consecutive digits). \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eUnfortunately, Mike lost integer $$$a$$$ before he could calculate $$$d$$$ himself. Now, to cheer him up, you want to find \u003cspan class\u003d\"tex-font-style-bf\"\u003eany binary\u003c/span\u003e integer $$$a$$$ of length $$$n$$$ such that $$$d$$$ will be \u003cspan class\u003d\"tex-font-style-bf\"\u003emaximum possible as integer\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eMaximum possible as integer means that $$$102 \u0026gt; 21$$$, $$$012 \u0026lt; 101$$$, $$$021 \u003d 21$$$ and so on.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$t$$$ ($$$1 \\leq t \\leq 1000$$$)\u0026nbsp;— the number of test cases.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains the integer $$$n$$$ ($$$1 \\leq n \\leq 10^5$$$)\u0026nbsp;— the length of $$$a$$$ and $$$b$$$.\u003c/p\u003e\u003cp\u003eThe second line of each test case contains binary integer $$$b$$$ of length $$$n$$$. The integer $$$b$$$ consists only of digits $$$0$$$ and $$$1$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the total sum of $$$n$$$ over all $$$t$$$ test cases doesn\u0027t exceed $$$10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case output one \u003cspan class\u003d\"tex-font-style-bf\"\u003ebinary\u003c/span\u003e integer $$$a$$$ of length $$$n$$$. Note, that $$$a$$$ or $$$b$$$ may have leading zeroes but must have the same length $$$n$$$.\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\u003e5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n110\n100\n101101\n101110\n\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 test case, $$$b \u003d 0$$$ and choosing $$$a \u003d 1$$$ gives $$$d \u003d 1$$$ as a result.\u003c/p\u003e\u003cp\u003eIn the second test case, $$$b \u003d 011$$$ so: \u003c/p\u003e\u003cul\u003e \u003cli\u003e if you choose $$$a \u003d 000$$$, $$$c$$$ will be equal to $$$011$$$, so $$$d \u003d 01$$$; \u003c/li\u003e\u003cli\u003e if you choose $$$a \u003d 111$$$, $$$c$$$ will be equal to $$$122$$$, so $$$d \u003d 12$$$; \u003c/li\u003e\u003cli\u003e if you choose $$$a \u003d 010$$$, you\u0027ll get $$$d \u003d 021$$$. \u003c/li\u003e\u003cli\u003e If you select $$$a \u003d 110$$$, you\u0027ll get $$$d \u003d 121$$$. \u003c/li\u003e\u003c/ul\u003e We can show that answer $$$a \u003d 110$$$ is optimal and $$$d \u003d 121$$$ is maximum possible.\u003cp\u003eIn the third test case, $$$b \u003d 110$$$. If you choose $$$a \u003d 100$$$, you\u0027ll get $$$d \u003d 210$$$ and it\u0027s the maximum possible $$$d$$$.\u003c/p\u003e\u003cp\u003eIn the fourth test case, $$$b \u003d 111000$$$. If you choose $$$a \u003d 101101$$$, you\u0027ll get $$$d \u003d 212101$$$ and it\u0027s maximum possible $$$d$$$.\u003c/p\u003e\u003cp\u003eIn the fifth test case, $$$b \u003d 001011$$$. If you choose $$$a \u003d 101110$$$, you\u0027ll get $$$d \u003d 102121$$$ and it\u0027s maximum possible $$$d$$$.\u003c/p\u003e"}}]}