Mathematical Modelling Class
题号:NC205338
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

In recent years, hundreds and thousands of students in our school are eager to register in the Mathematics Modelling Advanced Class. Because of the huge number of people and the limited size of the classroom, Professor Wang had to separate all the students randomly into two different classes, one in the morning and the other in the afternoon.
However, after Professor Wang randomly assigned classes of all the registered students, there were always some students who thought that the time of the Mathematics Modelling Advanced Class was not suitable. Some students assigned to the morning class can't get up early, or some students assigned to the afternoon class conflict with other activities (like ACM Weekly Training Contest), or maybe some students wanted to have the same class with their girlfriend (or their boyfriend) and so on. Therefore, it caused many students to apply for a class change, so that it really brought a great workload to the customer service students.

This year, in order to avoid this kind of situation, Professor Wang did a survey at first. There are n students enrolled in the Mathematics Modelling Advanced Class. It is known whether the i-th student is willing to have the morning class (if yes, then , otherwise ), and the i-th student is willing to have the afternoon class (if yes, then , otherwise ). Although there are some naughty guys who don't want to join in any classes, Professor Wang will also arrange classes for them.
Now Professor Wang split all the students into two classes in such a way that:
  • Each student takes exactly one class (morning class or afternoon class).
  • The number of students in the two classes is approximately equal (i.e. if n is even, the number of students of two classes is equal to . And if n is odd, there is one more person in the morning class than afternoon class),
  • In order to balance everyone's needs and make everyone as satisfied as possible, the number of students who want to go to the morning class assigned to the morning class is the same as the number of students who want to go to the afternoon class are assigned to the afternoon class.
Given the total number of students who were willing to enroll in the Mathematics Modelling Advanced Class and all their survey information, please help Professor Wang divide all the students into two different classes.

输入描述:

There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case:
The first line contains a single integer n (2 ≤ n ≤ 5000), indicating the total number of students who were willing to enroll in the Mathematics Modelling Advanced Class.
The second line contains n digits a_1a_2...a_n, the i-th of which is equal to 1 if the i-th student can take the class in the morning, and 0 otherwise.
The third line contains n digits b_1b_2...b_n, the i-th of which is equal to 1 if the i-th student can take the class in the afternoon, and 0 otherwise.
It's guaranteed that the sum of n of all test cases will not exceed 5×.

输出描述:

For each test case, output  distinct integers, every two integers separated by a space, indicating the indices of the students that will be assigned to the morning class.
If there are multiple answers, print any.
If there is no solution, print a single integer -1.
Note: Please, DO NOT output extra spaces at the beginning or the end of each line, or your answer may be considered incorrect!
示例1

输入

复制
5
4
0011
0101
6
000000
111111
5
00110
11000
8
00100101
01111100
7
0001111
1110000

输出

复制
1 4
-1
3 4 5
1 2 3 6
-1

备注:

In the first example, one of the possible divisions into two classes is as follows: in the morning class students 1 and 4 should take part. Then the number of students in the morning class who want to attend the class is equal to 1. And the number of students in the afternoon class who want to attend the class is 1 as well.
In the second example, the division is not possible.
In the third example, one of the possible divisions is as follows: in the morning class students 3, 4 and 5 should take part. Then in the morning class there are 2 students who want to attend the class. And the number of students in the afternoon class who want to attend the class is 2 as well.