Problem: This is an interactive problem.

This is a hard version of the problem. The difference from the easy version is that in the hard version 1 ≤ t ≤ min(n, 10^4) and the total number of queries is limited to 6 ⋅ 10^4.

Polycarp is playing a computer game. In this game, an array consisting of zeros and ones is hidden. Polycarp wins if he guesses the position of the k-th zero from the left t times.

Polycarp can make no more than 6 ⋅ 10^4 requests totally of the following type: 

  * ? l r — find out the sum of all elements in positions from l to r (1 ≤ l ≤ r ≤ n) inclusive. 



To make the game more interesting, each guessed zero turns into one and the game continues on the changed array. More formally, if the position of the k-th zero was x, then after Polycarp guesses this position, the x-th element of the array will be replaced from 0 to 1.

Help Polycarp win the game.

Interaction

First, your program must read two integers n and t (1 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ t ≤ min(n, 10^4)).

Then t lines follow, each of which contains one integer k (1 ≤ k ≤ n). It is guaranteed that at the moment of the request the array contains at least k zeros. In order to get the next value of k, you must output the answer for the previous value of k.

After that, you can make no more than 6 ⋅ 10^4 requests in total.

Use the following format to output the answer (it is not a request, it doesn't count in 6 ⋅ 10^4): 

  * ! x — position of the k-th zero. 



Positions in the array are numbered from left to right from 1 to n inclusive.

After printing t answers, your program should exit immediately.

In this task, the interactor is not adaptive. This means that within the same test, the hidden array and the queries do not change.

In case of an incorrect query, -1 will be displayed. When this value is received, your program must immediately exit normally (for example, by calling exit(0)), otherwise, the testing system may issue an arbitrary verdict.

If the number of requests is exceeded, the verdict wrong answer will be displayed.

Your solution may get the verdict Idleness limit exceeded if you don't print anything or forget to flush the output buffer.

To flush the output buffer, you need to do the following immediately after the query output and the end-of-line character:

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



Hacks

Use the following format for hacks:

On the first line print the string s (1 ≤ |s| ≤ 2 ⋅ 10^5), consisting of zeros and ones, and an integer t (1 ≤ t ≤ min(|s|, 10^4)) — hidden array and number of requests, respectively. In the next t lines output the number k (1 ≤ k ≤ |s|).

The hacked solution will not have direct access to the hidden array.

Example

Input


6 2

2

2

1

1

0

1

0

Output


? 4 6

? 1 1

? 1 2

? 5 5

! 5

? 2 2

! 2

Note

In the first test, the array [1, 0, 1, 1, 0, 1] is hidden. After answering the query k=2, the array changed to [1, 0, 1, 1, 1, 1].

Solution (in CPP):

Solution:
          #pragma GCC optimize("Ofast") 
        #pragma GCC target("avx,avx2,fma")

            #include <bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            typedef vector<long long> vl;
            typedef vector<int> vi;
            #define PB push_back 
            #define MP make_pair
            #define ln "\n"
            #define max(a, b) (a < b ? b : a) 
            #define min(a, b) ((a > b) ? b : a) 
            #define mod 1e9 + 7 
            #define forn(i,e) for(ll i=0; i<e; i++)
            #define forsn(i,s,e) for(ll i=s; i<e; i++)
            #define rforn(i,e) for(ll i=e; i>=0; i--)
            #define rforsn(i,s,e) for(ll i=s; i>=e; i--)
            #define vasort(v) sort(v.begin(), v.end())
            #define vdsort(v) sort(v.rbegin(), v.rend())
            
            #define F first
            #define S second
             
            #define out1(x1) cout << x1 << ln
            #define out2(x1,x2) cout << x1 << " " << x2 << ln
            #define out3(x1,x2,x3) cout << x1 << " " << x2 << " " << x3 << ln
            #define out4(x1,x2,x3,x4) cout << x1 << " " << x2 << " " << x3 << " " << x4 << ln
            #define out5(x1,x2,x3,x4,x5) cout << x1 << " " << x2 << " " << x3 << " " << x4 << " " << x5 << ln
            #define out6(x1,x2,x3,x4,x5,x6) cout << x1 << " " << x2 << " " << x3 << " " << x4 << " " << x5 << " " << x6 << ln
             
            #define in1(x1) cin >> x1
            #define in2(x1,x2) cin >> x1 >> x2
            #define in3(x1,x2,x3) cin >> x1 >> x2 >> x3
            #define in4(x1,x2,x3,x4) cin >> x1 >> x2 >> x3 >> x4
            #define in5(x1,x2,x3,x4,x5) cin >> x1 >> x2 >> x3 >> x4 >> x5
            #define in6(x1,x2,x3,x4,x5,x6) cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6
             
            #define arrin(a,n) forn(i,n) cin >> a[i];
            #define arrout(a,n) forn(i,n) {cout << a[i] << " ";} cout << ln;
             
            #define zoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
            int nxt() {int x; cin >> x; return x;}
            const ll INF = int(1e9) + 99;
            ll gcd(ll a, ll b)  {if (b == 0) return a;  return gcd(b, a % b);  } 
            //ll fact(ll n)    {ll t=1;if(n==0 ||n==1) return t; for(int i=2;i<=n;i++) t*=i; return t;} 
            const int N = int(2e5) + 99;
            vl plist;
           
            bool prime[200005]; 
            void SieveOfEratosthenes(int n) 
            { 
                // Create a boolean array "prime[0..n]" and initialize 
                // all entries it as true. A value in prime[i] will 
                // finally be false if i is Not a prime, else true. 
                memset(prime, true, sizeof(prime)); 
              
                for (int p=2; p*p<=n; p++) 
                { 
                    // If prime[p] is not changed, then it is a prime 
                    if (prime[p] == true) 
                    { 
                        // Update all multiples of p greater than or  
                        // equal to the square of it 
                        // numbers which are multiple of p and are 
                        // less than p^2 are already been marked.  
                        for (int i=p*p; i<=n; i += p) 
                            prime[i] = false; 
                    } 
                } 
              
                // Print all prime numbers 
                for (int p=2; p<=n; p++) 
                   if (prime[p]) 
                      plist.PB(p);
            } 
            ll power(ll x,  ll y, ll p)  
            {  
                ll res = 1;     // Initialize result  
              
                x = x % p; // Update x if it is more than or  
                            // equal to p 
               
                if (x == 0) return 0; // In case x is divisible by p; 
              
                while (y > 0)  
                {  
                    // If y is odd, multiply x with result  
                    if (y & 1)  
                        res = (res*x) % p;  
              
                    // y must be even now  
                    y = y>>1; // y = y/2  
                    x = (x*x) % p;  
                }  
                return res;  
            }  
            int _mergeSort(int arr[], int temp[], int left, int right);
            int merge(int arr[], int temp[], int left, int mid, int right);
              
            /* This function sorts the input array and returns the
            number of inversions in the array */
            int mergeSort(int arr[], int array_size)
            {
                int temp[array_size];
                return _mergeSort(arr, temp, 0, array_size - 1);
            }
              
            /* An auxiliary recursive function that sorts the input array and
            returns the number of inversions in the array. */
            int _mergeSort(int arr[], int temp[], int left, int right)
            {
                int mid, inv_count = 0;
                if (right > left) {
                    /* Divide the array into two parts and
                    call _mergeSortAndCountInv()
                    for each of the parts */
                    mid = (right + left) / 2;
              
                    /* Inversion count will be sum of
                    inversions in left-part, right-part
                    and number of inversions in merging */
                    inv_count += _mergeSort(arr, temp, left, mid);
                    inv_count += _mergeSort(arr, temp, mid + 1, right);
              
                    /*Merge the two parts*/
                    inv_count += merge(arr, temp, left, mid + 1, right);
                }
                return inv_count;
            }
              
            /* This funt merges two sorted arrays
            and returns inversion count in the arrays.*/
            int merge(int arr[], int temp[], int left,
                      int mid, int right)
            {
                int i, j, k;
                int inv_count = 0;
              
                i = left; /* i is index for left subarray*/
                j = mid; /* j is index for right subarray*/
                k = left; /* k is index for resultant merged subarray*/
                while ((i <= mid - 1) && (j <= right)) {
                    if (arr[i] <= arr[j]) {
                        temp[k++] = arr[i++];
                    }
                    else {
                        temp[k++] = arr[j++];
              
                        /* this is tricky -- see above
                        explanation/diagram for merge()*/
                        inv_count = inv_count + (mid - i);
                    }
                }
              
                /* Copy the remaining elements of left subarray
            (if there are any) to temp*/
                while (i <= mid - 1)
                    temp[k++] = arr[i++];
              
                /* Copy the remaining elements of right subarray
            (if there are any) to temp*/
                while (j <= right)
                    temp[k++] = arr[j++];
              
                /*Copy back the merged elements to original array*/
                for (i = left; i <= right; i++)
                    arr[i] = temp[i];
              
                return inv_count;
            }
            ll binomialCoeff(ll n, ll k)
            {
                ll res = 1;
              
                // Since C(n, k) = C(n, n-k)
                if (k > n - k)
                    k = n - k;
              
                // Calculate value of
                // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
                for (ll i = 0; i < k; ++i) {
                    res *= (n - i);
                    res /= (i + 1);
                }
              
                return res;
            }
             
            

            bool sortbysec(const pair<int,int> &a, 
                          const pair<int,int> &b) 
            { 
                return (a.second < b.second); 
            } 
            /*-----------------------------Code begins------------------------*/
             bool sortinrev(const pair<int,int> &a,  
                       const pair<int,int> &b) 
            { 
               return (a.first > b.first); 
            } 





    ll modInverse(ll a, ll m) 
    { 
        ll g = gcd(a, m); 
        if (g != 1) 
            cout << "Inverse doesn't exist"; 
        else
        { 
            // If a and m are relatively prime, then modulo inverse 
            // is a^(m-2) mode m 
            return  power(a, m-2, m); 
        } 
    } 




    vector<ll> v1(5001);
    void modFact(int n, int p) 
    { 
        if (n >= p) 
            return ; 
      
        ll result = 1; v1[0]=1;
        for (int i = 1; i <= n; i++) 
            {result = (result * i) % p; 
                v1[i]=result;
            }
      
        return ;
    } 
    ll nCrModPFermat(ll n, int r, int p)
    {
        // If n<r, then nCr should return 0
        if (n < r)
            return 0;
        // Base case
        if (r == 0)
            return 1;
     
        // Fill factorial array so that we
        // can find all factorial of r, n
        // and n-r
        
     
        return (v1[n] * modInverse(v1[r], p) % p
                * modInverse(v1[n - r], p) % p)
               % p;
    }


int minDistance(int dist[], bool sptSet[], int V)
{
    // Initialize min value
    

    int min = INT_MAX, min_index;
  
    for (int v = 0; v < V; v++)
        if (sptSet[v] == false && dist[v] <= min)
            min = dist[v], min_index = v;
  
    return min_index;
}


    void dijkstra(vector< vector<int> > & graph, int src)
{
    int V=graph.size();
   int dist[V]; // The output array.  dist[i] will hold the shortest
    // distance from src to i
  
    bool sptSet[V]; // sptSet[i] will be true if vertex i is included in shortest
    // path tree or shortest distance from src to i is finalized
  
    // Initialize all distances as INFINITE and stpSet[] as false
    for (int i = 0; i < V; i++)
        dist[i] = INT_MAX, sptSet[i] = false;
  
    // Distance of source vertex from itself is always 0
    dist[src] = 0;
  
    // Find shortest path for all vertices
    for (int count = 0; count < V - 1; count++) {
        // Pick the minimum distance vertex from the set of vertices not
        // yet processed. u is always equal to src in the first iteration.
        int u = minDistance(dist, sptSet,V);
  
        // Mark the picked vertex as processed
        sptSet[u] = true;
  
        // Update dist value of the adjacent vertices of the picked vertex.
        for (int v = 0; v < V; v++)
  
            // Update dist[v] only if is not in sptSet, there is an edge from
            // u to v, and total weight of path from src to  v through u is
            // smaller than current value of dist[v]
            if (!sptSet[v]  && dist[u] != INT_MAX
                && dist[u] + graph[u][v] < dist[v])
                dist[v] = dist[u] + graph[u][v];
    }
  
    for(int i=0;i<V;i++)
    {
        if(dist[i]>1000000006)
            cout<<-1<<" ";
        else cout<<dist[i]<<" ";
    }
    cout<<ln;
    return;
}

void showpq(priority_queue<int> gq)
{
    priority_queue<int> g = gq;
    while (!g.empty()) {
        cout << '\t' << g.top();
        g.pop();
    }
    cout << '\n';
}

map<pair<int,int> ,int> mp1,mp2;

void dec(int pos, int L, int R) {
    if(L>R) return;
    if(mp1[{L,R}]==1)
    mp2[{L, R}]++;

    if (L != R) {
        int M = (L + R) / 2;
        if (pos <= M)
            dec(pos, L, M);
        //if(pos>=M)
        else    dec(pos, M + 1, R);
    }
}


    void solve()
     {  ll l,x=0,r,c,g,n,y,m,x1=0,x2=0,x3=0,ans=1e17-7,
        ans1=-1e9+7,ans13=0,ans2=0,ans3=0,ans4=1,ans5=1e9+7,
        flag1=-1,flag2=-1;int k;
        //n planes //k decay
        //map<char,int> mp;cin>>n;
        int t;
        cin>>n>>t;
       
        
        if(n<=60000)
        {
        cin>>k;

            vi v2;
           forn(i,n)
           {

            cout<<"? "<<i+1<<" "<<i+1<<ln;
            cout.flush();
            cin>>x1;
            if(x1==0)
                v2.PB(i+1);

            }
             cout<<"! "<<v2[k-1]<<ln;cout.flush();
             v2.erase(v2.begin()+k-1);

            forn(i,t-1)
            {
                cin>>k;
             //

                


                cout<<"! "<<v2[k-1]<<ln;cout.flush();
             v2.erase(v2.begin()+k-1);
                

            }

           


            return;
        }
         
 
        while(t--)
        {
            cin>>k;
 
            x=1;y=n;
             r=(x+y)/2;
            forn(i,20)
            {
                
                if(mp1[MP(x,r)]==0)
                {
                cout<<"? "<<x<<" "<<r<<endl;
                cout.flush();
                cin>>x1;
                mp1[MP(x,r)]=1;
                mp2[MP(x,r)]=x1;
 
                }
                else 
                    x1=mp2[MP(x,r)];
                //out2(r-x+1-x1,k);
                if(r-x+1-x1>k)
                {
                    y=r;
                    r=(x+y)/2;
 
 
                }
                else if(r-x+1-x1==k)    
                {
                    if(x==y)
                    {
                        cout<<"! "<<x<<endl;
                        cout.flush();
                        dec(x,1,n);
                        break;
                    }
                    y=r;
                    r=(x+y)/2;
                    ans2=r;
 
 
                }
                else
                {
                    k-=r-x+1-x1;
                    x=r+1;
                    r=(x+y)/2;
                    
 
                }
               
 
            }
        }
     
    }
            int main() {
                #ifndef ONLINE_JUDGE
                freopen("input.txt","r",stdin); 
                freopen("output.txt","w",stdout);
                //freopen("error.txt","w",stderr);
                #endif
                zoom;
                //modFact(5001,1000000007);
                SieveOfEratosthenes(100000);
                
                
                ll t=1,t1;
                
                //cin>>t;
                t1=t;
                while(t--){
                   //cout<<"Case "<<t1-t<<": ";
                    solve();
                    //cout<<ln;
                    //cerr<<t<<" ";
                 }
             
                return 0;
            }