
Fax McClad, Croneria's most independent bounty hunter, has decided to form a crew of
The people that Fax can choose from are numbered from
Fax wants the crew to be able to work together flawlessly, so the crew should follow one of these two conditions:
- Among all pairs of people in the crew, they know each other.
- Among all pairs of people in the crew, they don't know each other.
This is because people tend to prefer to work with people they know than those they don't know. Fax wants to ensure that each person will want to work with others equally.
In order to accomplish this, Fax can perform the following three actions:
A x
: Ask person to categorize all of the people that they know and don't know. Because Fax is lazy, he will do this at most times.C a b ...
: Create a crew containing people with distinct numbers . There should be people in this crew.C -1
: Give up because there is no way to create a crew.
Constraints
Subtask | Points | |||
---|---|---|---|---|
1 | 5 | |||
2 | 10 | |||
3 | 10 | |||
4 | 50 | |||
5 | 25 |
Important Note: Up to 3 seconds of the time limit could be used up by the generator.
Input Specification
The first line of input will contain three integers
Output Specification
To answer this problem, print C a b ...
. The C -1
. Afterwards, your program must terminate.
Interaction
This is an interactive problem. After reading the first line of input, your program can make queries.
A query is in the form A x
, where A x
and flushing (see Note 1), a string of length 1
's and 0
's. If the 1
, then person 0
, then person 1
.
You must not make more than
After your program is done making queries, your program can print an answer. If there are C a b ...
as the answer. If there is no solution, print C -1
instead. Afterwards, make sure you flush and terminate your program.
Note 1: To flush, you can use fflush(stdout);
in C++, or System.out.flush();
in Java, or import sys; sys.stdout.flush()
in Python 2/3. For other languages, search in its documentation.
Note 2: An answer does not count as a query.
Note 3: In some test cases, the behaviour of the interactor is adaptive. This means that in these test cases, the interactor does not have a fixed response for each person. Instead, the responses given by the interactor may depend on the queries made by your solution. It is guaranteed that the interactor responds in such a way that after each response, there is at least one state consistent with all the responses given so far.
Sample Interaction
>>>
denotes your output; don't actually print this out.
9 3 5
>>> A 1
100100100
>>> A 2
010010010
>>> C 1 2 3
All pairs of people in the crew don't know each other. In total,
Comments