#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define Unique(v) sort(all(v));v.erase(unique(all(v)),v.end());
#define sz(v) ((int)v.size())
//#define int long long  
using namespace std;
typedef vector<int> vi;
#define y1 abacaba
//#define left oooooopss
#define db(x) cerr << #x <<" == "<<x << endl;
#define db2(x,y) cerr<<#x <<" == "<<x<<", "<<#y<<" == "<<y<<endl;
#define db3(x,y,z) cerr << #x<<" == "<<x<<", "<<#y<<" == "<<y<<", "<<#z<<" == "<<z<<endl;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
inline ll mod(ll n, ll m ){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll b,ll e,ll m){
  b%=m;
  ll ans = 1;
  for (; e; b = b * b % m, e /= 2)
      if (e & 1) ans = ans * b % m;
  return ans;
}
int flag=0;
int ask(int h,int w,int i1,int j1,int i2,int j2){
  if(flag){
    swap(h,w);
    swap(i1,j1);
    swap(i2,j2);
  }
  cout << "? "<<h<<" "<<w<<" "<<i1<<" "<<j1<<" "<<i2<<" "<<j2<<endl;
  cout.flush();
  int r;
  cin >> r;
  return r;
}

vector<int> pr;
map<int,int> bad;

int ruim(int i){
  for(auto it : bad){
    if(i%it.ff==0)return 1;
  }
  return 0;
}

void solve(int n,int m){

  if(m == 1)return ;

  int mn=0;
  rep(i,2,m+1)if(m%i==0 and !ruim(i)){
    mn = i;
    break;
  }
  if(mn==0)return;


  if(mn == 2){
    if(ask(n,m/mn,1,1,1,(m/mn) + 1)){
      pr.pb(mn);
      solve(n,m/2);
    }

  }else{
    assert(mn%2==1);
    int tam = (m - m/mn);
    assert(tam%2==0);
    tam/=2;
    if(!ask(n,tam,1,1,1,tam+1)){
    }
    else if(ask(n,m/mn,1,1,1,m - (m/mn) + 1)){
      pr.pb(mn);
      solve(n,m/mn);
    }

  }

  bad[mn] = 1;
  solve(n,m);

} 

ll get(vi v){
  sort(all(v));
  ll tot=1;
  
  for(int i=0;i<sz(v);){
    int k=0;
    int j=i;
    while(i<sz(v) and v[i]==v[j]){
      i++;k++;
    }
    tot*=(k + 1);
  }
  return tot;
}

int32_t main(){
  fastio;
  int n,m;
  cin >> n >> m;
  solve(n,m);
  flag = 1;
  ll qtda = get(pr);
  pr.clear();
  bad.clear();
  solve(m,n);
  ll qtdb = get(pr);
  cout << "! "<< qtda * qtdb << endl;
  // math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}