#abc299d. [abc299_d]Find by Query

[abc299_d]Find by Query

Problem Statement

This is an interactive task, where your program and the judge interact via Standard Input and Output.

The judge has a string of length NN consisting of 00 and 11: S=S1S2ldotsSNS = S_1S_2\\ldots S_N. Here, S1=0S_1 = 0 and SN=1S_N = 1.

You are given the length NN of SS, but not the contents of SS. Instead, you can ask the judge at most 2020 questions as follows.

  • Choose an integer ii such that 1leqileqN1 \\leq i \\leq N and ask the value of SiS_i.

Print an integer pp such that 1leqpleqN11 \\leq p \\leq N-1 and SpneqSp+1S_p \\neq S_{p+1}.
It can be shown that such pp always exists under the settings of this problem.

Constraints

  • 2leqNleq2times1052 \\leq N \\leq 2 \\times 10^5

Input and Output

First, receive the length NN of the string SS from Standard Input:

NN

Then, you get to ask the judge at most 2020 questions as described in the problem statement.

Print each question to Standard Output in the following format, where ii is an integer satisfying 1leqileqN1 \\leq i \\leq N:

? ii

In response to this, the value of SiS_i will be given from Standard Input in the following format:

SiS_i

Here, SiS_i is 00 or 11.

When you find an integer pp satisfying the condition in the problem statement, print it in the following format, and immediately quit the program:

! pp

If multiple solutions exist, you may print any of them.

Notes

  • Print a newline and flush Standard Output at the end of each message. Otherwise, you may get a TLE