#include<bits/stdc++.h>

using namespace std;

#define loop(i, l, r) for(int i = (int) l; i <= (int) r; i++)
#define rloop(i, r, l) for(int i = (int) r; i >= (int) l; i--)

#define vi vector<int>
#define ii pair<int, int>
#define eb emplace_back
#define all(x) begin(x), end(x)
#define fi first
#define se second

#define rand rng
#define sp ' '


#define int long long

const int maxN = 1005, mod = 1e9 + 7, inf  = 1005;

int N, M;
vi fac[maxN];

void prep()
{
	loop(i, 2, maxN - 1)
	{
		if(fac[i].empty())
		{
			for(int j = i; j < maxN; j += i)
			{
				fac[j].eb(i);
			}
		}
	}
}
int q;
int ask(int w, int h, int i1, int j1, int i2, int j2)
{
	q++;
//	assert(q <= 3 * log2(N + M));
	cout << "? " << w << sp << h <<sp << i1 << sp << j1 << sp << i2 << sp << j2 <<endl;
	int re;
	cin >> re;
	return re;
}
int binask(int t, int p, bool row)
{
	while(p)
	{
		if(p == 1) return 1;
		int m = p >> 1;
		int h = row? m * t: N;
		int w = row? M: m * t;
		int i2 = row? (p - m) * t + 1: 1;
		int j2 = row? 1: (p - m) * t + 1;
		if(!ask(h, w, 1, 1, i2, j2)) return 0;
		p -= m;
	}	
	return 1;
}
int solve(int sz, bool row)
{
	int re = 0;
	int mn = sz;
	for(int p: fac[sz])
	{
		while(mn % p == 0)
		{
			if(binask(mn / p, p, row)) mn /= p;
			else break;
		}
	}
//	if(N == M and M ==512 and !row)cout << mn << endl;
	loop(i, 1, sz) if(i % mn == 0 and sz % i == 0) re++;
	return re;
}

signed main()
{
//	ios_base::sync_with_stdio(0);
//	cin.tie(0);
//	cout.tie(0);
	cin >> N >> M;
	prep();
	int re = solve(N, 1) * solve(M, 0);
//	if(N == 512 and M == 512) cout << re << endl;
	cout << "! " << re << endl;
}