Secret of Tianqiu Valley
시간 제한2초메모리 제한1024 MB
불이 꺼진 횟불을 켜면 양옆 횟불의 상태가 뒤집히는 원형 배치에서, 2n번 이내의 이동으로 모든 횟불을 켜는 방법을 출력하거나 불가능함을 판정한다.
문제
In the north tower of Tianqiu Valley's ruins, there are some flame torch puzzles and Lumine the traveler is facing the last and the hardest one.

Source: Genshin Impact Official
There are torches in a circle and some torches have been ignited initially. The -th and the -th are adjacent for all .
To 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.
Time is money, Lumine wants to solve the puzzle in moves or determine that the puzzle is unsolvable.
입력
There are multiple test cases. The first line of the input contains an integer indicating the number of test cases. For each test case:
The first line of the input contains an integer () indicating the number of torches in the circle.
The second line contains a binary string of length (). If the -th torch is extinguished initially; If the -th torch is ignited initially. It is guaranteed that not all the torches have been ignited initially.
It is also guaranteed that the sum of of all test cases will not exceed .
출력
If the puzzle is unsolvable, output "0" (without quotes).
Otherwise, output an integer in the first line indicating the number of moves Lumine needs to solve the puzzle. Then output a line containing integers separated by a space, where indicating that Lumine will ignite the -th torch in the -th move. If there are multiple answers print any of them.
힌트
For the first sample test case, the status of the torch will change like this: .