{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIn the north tower of Tianqiu Valley\u0027s ruins, there are some flame torch puzzles and Lumine the traveler is facing the last and the hardest one.\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/fcaf0068ac28a5b0abffb81649b58ea6?v\u003d1726211324\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"525px\"\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-sl\"\u003eSource: Genshin Impact Official\u003c/span\u003e \u003c/p\u003e\u003c/center\u003e\u003cp\u003eThere are $$$n$$$ torches in a circle and some torches have been ignited initially. The $$$i$$$-th and the $$$(i \\bmod n +1)$$$-th are adjacent for all $$$1 \\le i \\le n$$$.\u003c/p\u003e\u003cp\u003eTo solve the puzzle, all the torches should be ignited. In each move, Lumine can ignite an extinguished torch, and the status of the adjacent torches will be reversed affected by the supernatural. That is, each of the adjacent torches will be ignited if it is currently extinguished, or be extinguished if it is currently ignited.\u003c/p\u003e\u003cp\u003eTime is money, Lumine wants to solve the puzzle in $$$2n$$$ moves or determine that the puzzle is unsolvable.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThere are multiple test cases. The first line of the input contains an integer $$$T$$$ indicating the number of test cases. For each test case:\u003c/p\u003e\u003cp\u003eThe first line of the input contains an integer $$$n$$$ ($$$3 \\le n \\le 10^5$$$) indicating the number of torches in the circle.\u003c/p\u003e\u003cp\u003eThe second line contains a binary string $$$s_1s_2\\cdots s_n$$$ of length $$$n$$$ ($$$s_i \\in \\{\\text{\u00270\u0027}, \\text{\u00271\u0027}\\}$$$). If $$$s_i \u003d \\text{\u00270\u0027}$$$ the $$$i$$$-th torch is extinguished initially; If $$$s_i \u003d \\text{\u00271\u0027}$$$ the $$$i$$$-th torch is ignited initially. It is guaranteed that not all the torches have been ignited initially.\u003c/p\u003e\u003cp\u003eIt is also guaranteed that the sum of $$$n$$$ of all test cases will not exceed $$$10^6$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf the puzzle is unsolvable, output \"0\" (without quotes).\u003c/p\u003e\u003cp\u003eOtherwise, output an integer $$$k$$$ $$$(1 \\le k \\le 2n)$$$ in the first line indicating the number of moves Lumine needs to solve the puzzle. Then output a line containing $$$k$$$ integers $$$t_1, t_2, \\cdots, t_k$$$ separated by a space, where $$$t_i$$$ indicating that Lumine will ignite the $$$t_i$$$-th torch in the $$$i$$$-th move. If there are multiple answers print any of them.\u003c/p\u003e\u003cp\u003ePlease, DO NOT output extra spaces at the end of each line or your solution may be considered incorrect!\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\n5\n00000\n3\n001\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\n2 5 1 2 3 4 2\n0\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\u003eFor the first sample test case, the status of the torch will change like this: $$$00000$$$ $$$\\to$$$ $$$11100$$$ $$$\\to$$$ $$$01111$$$ $$$\\to$$$ $$$10110$$$ $$$\\to$$$ $$$01010$$$ $$$\\to$$$ $$$00100$$$ $$$\\to$$$ $$$00011$$$ $$$\\to$$$ $$$11111$$$.\u003c/p\u003e"}}]}