#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; }
#define debug(a) cerr << "(" << #a << ": " << a << ")\n";
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 1e5+1, oo = 1e9;
const int store=1e3 + 1;
bitset<store> sieve={};
int factor[store] = {};
void makesieve() {
    for(int i = 2; i < store;++i) {
        if(!sieve[i]) {
            for(int j = i;j<store;j+=i) {
                if(!sieve[j]) {
                    factor[j] = i;
                    sieve[j] = true;
                }
            }
        }
    }
}
int nn,mm;
bool test(int l, int r, int n, bool vertical) {
    cout << "? ";
    if(vertical) {
        cout << vi{n,mm,l+1,1,r+1,1} << endl;
    } else {
        cout << vi{nn,n,1,l+1,1,r+1} << endl;
    }
    int t; cin >> t;
    return t==1;
}
int check(int p, int cnt, int n, bool vertical) {
    if(cnt==0) {
        return 0;
    }
    if(p==2) {
        if(!test(0,n/2, n/2, vertical)) {
            return 0;
        }
        return 1+check(2,cnt-1,n/2,vertical);
    } else {
        int len = n/p;
        if(!test(0, p/2 * len, p/2 * len, vertical) or !test(0, (1 + p/2) * len, p/2 * len, vertical)) {
            return 0;
        }
        return 1+check(p,cnt-1,n/p,vertical);
    }
}
int getans(int n, bool vertical = true) {
    int ans = 1;
    int ori = n;
    while(n!=1) {
        int tmp = 0;
        int f = factor[n];
        while(f==factor[n]) {
            tmp++;
            n/=f;
        }
        ans*=1+check(f,tmp,ori, vertical);
    }
    return ans;
}
int main() {
    makesieve();
    cin >> nn >> mm;
    int r = getans(nn);
    int c = getans(mm,false);
    cout << "! " << r*c << endl;
    
}