Politicians and Competitive Programmers
This is an interactive problem
There are citizens in SmartLand, numbered from to . Surprisingly, each of them is either politician or a competitive programmer (but not both), and everyone in the SmartLand knows who the others are. Of course, competitive programmers always tell truth and politicians always lie.
You want to determine, for each citizen of SmartLand, whether he is a politician or a competitive programmer. To do this, you can do the following:
Choose three distinct citizens , , , and ask the following question: "Is it true that would answer "Yes" to the question "Is competitive programmer?""
However, there is an important constraint: You can't ask the same citizen twice. That is, each citizen can be chosen as at most once.
Determine for each citizen, whether they are competitive programmers or politicians.
Qarşılıqlı təsir
Start by reading an integer () — the number of citizens of SmartLand.
To ask the question, output:
?
Here , , must be distinct integers with , and couldn't have been asked questions before.
In response, the interactor will output , if answers "Yes", and otherwise.
When you want to output answer, output:
!
Here is a binary string of length , and should be , if citizen is competitive programmer, and if he is politician.
Make sure to exit immediately to avoid getting other verdicts.
If you ask the invalid query, you will receive a verdict Wrong Answer
.
After printing a query do not forget to output the end of the line and flush the output. Otherwise, you will get Idleness limit exceeded
verdict.
To do this, use:
fflush(stdout)
orcout.flush()
in C++;System.out.flush()
in Java;stdout.flush()
in Python;
It is guaranteed that the roles of all citizens are fixed before the start of the interaction. In other words, the interactor is not adaptive.
Nümunələr
Qeyd
In the sample, citizens , , , are competitive programmers, and citizen is politician.
Note that the queries in the sample are not sufficient to determine who each citizen is, but nobody forbids you to answer anyways...