#P1746E2. Joking (Hard Version)

Joking (Hard Version)

No submission language available for this problem.

Description

The only difference between this problem and the hard version is the maximum number of questions.

This is an interactive problem.

There is a hidden integer 1xn1 \le x \le n which you have to find. In order to find it you can ask at most 53\mathbf{53} questions.

In each question you can choose a non-empty integer set SS and ask if xx belongs to SS or not, after each question, if xx belongs to SS, you'll receive "YES", otherwise "NO".

But the problem is that not all answers are necessarily true (some of them are joking), it's just guaranteed that for each two consecutive questions, at least one of them is answered correctly.

Additionally to the questions, you can make at most 22 guesses for the answer xx. Each time you make a guess, if you guess xx correctly, you receive ":)" and your program should terminate, otherwise you'll receive ":(".

As a part of the joking, we will not fix the value of xx in the beginning. Instead, it can change throughout the interaction as long as all the previous responses are valid as described above.

Note that your answer guesses are always answered correctly. If you ask a question before and after a guess, at least one of these two questions is answered correctly, as normal.

The only line of the input contains a single integer nn (1n1051 \le n \le 10^5), the maximum possible value of xx.

Interaction

For each question, if you want to ask about a set SS, first print the character '?', then print the size of SS and then print the elements of SS one by one. Each element should be an integer between 11 and nn, the elements must be distinct. After each question, read a string "YES" or "NO", as explained in the statement. You can make at most 5353 such questions.

If you want to guess for xx, first print the character '!' and then print your guess. After each guess, read ":)" or ":(". If you guess xx correctly, the answer is ":)" and your program should terminate immediately, otherwise you'll receive ":(". You can make at most 22 such guesses.

After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

  • fflush(stdout) or cout.flush() in C++;
  • System.out.flush() in Java;
  • flush(output) in Pascal;
  • stdout.flush() in Python;
  • see documentation for other languages.

Hacking is not allowed in this problem.

Input

The only line of the input contains a single integer nn (1n1051 \le n \le 10^5), the maximum possible value of xx.

Sample Input 1

6

NO

:(

NO

:)

Sample Output 1

? 5 1 2 5 4 3

! 6

? 4 1 2 3 4

! 5

Note

If the answer of the first question were correct, then xx would have been equal to 66, but as we can see in the first guess, 66 is not the answer.

So the answer of the first question is joking. As we know, the answer of at least one of our two questions is correct, since the answer of the first question was joking, the answer of the second question should be correct.

So we will understand that xx is not equal to 1,2,31, 2, 3 or 44, and we also knew that xx is not equal to 66 either. Hence xx should be equal to 55.