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:
/* Priyansh Agarwal*/

#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace chrono;
// using namespace __gnu_pbds;

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

#ifdef Priyansh31dec
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x);
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
// typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
// void _print(pbds v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}

/*---------------------------------------------------------------------------------------------------------------------------*/
ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}
ll expo(ll a, ll b, ll mod) {ll res = 1; while (b > 0) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b = b >> 1;} return res;}
void extendgcd(ll a, ll b, ll*v) {if (b == 0) {v[0] = 1; v[1] = 0; v[2] = a; return ;} extendgcd(b, a % b, v); ll x = v[1]; v[1] = v[0] - v[1] * (a / b); v[0] = x; return;} //pass an arry of size1 3
ll mminv(ll a, ll b) {ll arr[3]; extendgcd(a, b, arr); return arr[0];} //for non prime b
ll mminvprime(ll a, ll b) {return expo(a, b - 2, b);}
bool revsort(ll a, ll b) {return a > b;}
void swap(int &x, int &y) {int temp = x; x = y; y = temp;}
ll combination(ll n, ll r, ll m, ll *fact, ll *ifact) {ll val1 = fact[n]; ll val2 = ifact[n - r]; ll val3 = ifact[r]; return (((val1 * val2) % m) * val3) % m;}
void google(int t) {cout << "Case #" << t << ": ";}
vector<ll> sieve(int n) {int*arr = new int[n + 1](); vector<ll> vect; for (int i = 2; i <= n; i++)if (arr[i] == 0) {vect.push_back(i); for (int j = 2 * i; j <= n; j += i)arr[j] = 1;} return vect;}
ll mod_add(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a + b) % m) + m) % m;}
ll mod_mul(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a * b) % m) + m) % m;}
ll mod_sub(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a - b) % m) + m) % m;}
ll mod_div(ll a, ll b, ll m) {a = a % m; b = b % m; return (mod_mul(a, mminvprime(b, m), m) + m) % m;}  //only for prime m
ll phin(ll n) {ll number = n; if (n % 2 == 0) {number /= 2; while (n % 2 == 0) n /= 2;} for (ll i = 3; i <= sqrt(n); i += 2) {if (n % i == 0) {while (n % i == 0)n /= i; number = (number / i * (i - 1));}} if (n > 1)number = (number / n * (n - 1)) ; return number;} //O(sqrt(N))
/*--------------------------------------------------------------------------------------------------------------------------*/
const int maxN = 200005;
ll arr[maxN];
ll tree[4 * maxN];
ll lazy[4 * maxN];
void build_tree(int start, int end, int index)
{
	if (start == end)
	{
		tree[index] = arr[start];
		return;
	}
	int mid = (start + end) / 2;
	build_tree(start, mid, 2 * index);
	build_tree(mid + 1, end, 2 * index + 1);
	tree[index] = tree[2 * index] + tree[2 * index + 1];
}
void update(int start, int end, int index, int start_range, int end_range, ll value)
{
	if (start > end)
		return;
	if (lazy[index] != 0)
	{
		tree[index] += (end - start + 1) * lazy[index];
		if (start != end)
		{
			lazy[2 * index] += lazy[index];
			lazy[2 * index + 1] += lazy[index];
		}
		lazy[index] = 0;
	}
	if (start_range > end || end_range < start) //no overlap
		return;
	if (start_range <= start && end_range >= end) //complete overlap
	{
		tree[index] += (end - start + 1) * value;
		lazy[index] += value;
		if (start != end)
		{
			lazy[2 * index] += lazy[index];
			lazy[2 * index + 1] += lazy[index];
		}
		lazy[index] = 0;
		return;
	}
	int mid = (start + end) / 2;
	update(start, mid, 2 * index, start_range, end_range, value);
	update(mid + 1, end, 2 * index + 1, start_range, end_range, value);
	tree[index] = tree[2 * index] + tree[2 * index + 1];
}
ll query(int start, int end, int index, int left, int right)
{
	if (start > end)
		return 0;
	if (lazy[index] != 0)
	{
		tree[index] += (end - start + 1) * lazy[index];
		if (start != end)
		{
			lazy[2 * index] += lazy[index];
			lazy[2 * index + 1] += lazy[index];
		}
		lazy[index] = 0;
	}
	if (start > right || end < left)
		return 0;
	if (start >= left && end <= right)
		return tree[index];
	int mid = (start + end) / 2;
	int val1 = query(start, mid, 2 * index, left, right);
	int val2 = query(mid + 1, end, 2 * index + 1, left, right);
	return val1 + val2;
}
void find_ans(int left, int right, int k) {
	int start = left;
	int end = right;
	int ans = right;
	while (start <= end) {
		int mid = (start + end ) / 2;
		cout << "? " << left << " " << mid << endl;
		int x;
		cin >> x;
		x = (mid - left + 1) - x;
		if (x >= k) {
			ans = min(ans, mid);
			end = mid - 1;
		} else {
			start = mid + 1;
		}
	}
	cout << "! " << ans << endl;
}
void makeQueries(int k, int n) {
	int nSegments = n / 10 + (n % 10 != 0);
	int start = 0;
	int end = nSegments - 1;
	int ans = end;
	while (start <= end) {
		int mid = (start + end) / 2;
		int x = query(0, nSegments - 1, 1, 0, mid);
		if (x >= k) {
			ans = min(ans, mid);
			end = mid - 1;
		} else {
			start = mid + 1;
		}
	}
	int left = ans * 10;
	int right = min((ans + 1) * 10 - 1, n - 1);
	int alreadyHere = ans > 0 ? query(0, nSegments - 1, 1, 0, ans - 1) : 0;
	int toFind = k - alreadyHere;
	find_ans(left + 1, right + 1, toFind);
	update(0, nSegments - 1, 1, ans, ans, -1);
}
void solve() {
	int n, t;
	cin >> n >> t;
	int nSegments = n / 10 + (n % 10 != 0);
	int lastK = 0;
	bool precomputed = false;
	while (t--) {
		cin >> lastK;
		if (!precomputed) {
			for (int i = 0; i < nSegments; i++) {
				int left = i * 10;
				int right = min((i + 1) * 10 - 1, n - 1);
				cout << "? " << left + 1 << " " << right + 1 << endl;
				cin >> arr[i];
				arr[i] = right - left + 1 - arr[i];
			}
			build_tree(0, nSegments - 1, 1);
			for (int i = 0; i < 4 * nSegments; i++) {
				lazy[i] = 0;
			}
			precomputed = true;
		}
		makeQueries(lastK, n);
	}
}
int main() {
#ifdef Priyansh31dec
	freopen("Error.txt", "w", stderr);
#endif
	fastio();
	auto start1 = high_resolution_clock::now();
	solve();
	auto stop1 = high_resolution_clock::now();
	auto duration = duration_cast<microseconds>(stop1 - start1);
#ifdef Priyansh31dec
	cerr << "Time: " << duration . count() / 1000 << endl;
#endif
}