#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

ll mod_pow(ll x, ll n, ll mod){ // x ^ n % mod
    ll res = 1;
    while(n > 0){
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int ask(int a,int b,int c,int d){
	cout<<"? "<<a<<" "<<b<<" "<<c<<" "<<d<<"\n"<<flush;
	int res;
	cin>>res;
	return res;
}

ll h, w, n, K;
int a[55][55];

void dfs(int u, int d, int l, int r, int bomb){
    if(bomb == 0){
        srep(i,u,d){
            srep(j,l,r){
                a[i][j] = 0;
            }
        }
        return;
    }
    if(bomb == (d-u)*(r-l)){
        srep(i,u,d){
            srep(j,l,r){
                a[i][j] = 1;
            }
        }
        return;
    }
    
    int flag = 0;
    if((d-u)%2==0){
        flag = 1;
    }else if(d-u > r-l){
        flag = 1;
    }

    if(flag){
        int mh = (u+d)/2;
        int tmp = ask(u,l,mh-1,r-1);
        dfs(u,mh,l,r,tmp);
        dfs(mh,d,l,r,bomb-tmp);
    }else{
        int mw = (l+r)/2;
        int tmp = ask(u,l,d-1,mw-1);
        dfs(u,d,l,mw,tmp);
        dfs(u,d,mw,r,bomb-tmp);
    }

}

int main() {
    cin >> h >> w >> n >> K;
    rep(i,h)rep(j,w)a[i][j] = -1;

    int sol = 4;
    if(sol == 1){
        rep(i,h){
            rep(j,w){
                if(i%2==0&&j%2==0){
                    int res = ask(i,j,i+1,j+1);
                    if(res == 0){
                        a[i][j] = a[i][j+1] = a[i+1][j] = a[i+1][j+1] = 0;
                    }
                    if(res == 4){
                        a[i][j] = a[i][j+1] = a[i+1][j] = a[i+1][j+1] = 1;
                    }
                }
            }
        }
    }

    if(sol == 2){
        rep(i,h){
            rep(j,5){
                int bomb = ask(i,j*10,i,j*10+9);
                if(bomb == 0){
                    srep(k,j*10,j*10+9)a[i][k] = 0;
                    continue;
                }
                if(bomb == 1){
                    int l = 0, r = 10;
                    while(l+1 < r){
                        int m = (l+r)/2;
                        int tmp = ask(i,j*10+l,i,j*10+m-1);
                        if(tmp == 1) r = m;
                        else l = m;
                    }
                    srep(k,j*10,j*10+9)a[i][k] = 0;
                    a[i][j*10+l] = 1;
                    continue;
                }
                if(bomb >= 2){
                    srep(k,j*10,j*10+9){
                        if(bomb == 0){
                            a[i][k] = 0;
                        }else{
                            a[i][k] = ask(i,k,i,k);
                        }
                        bomb -= a[i][k];
                    }
                }
            }
        }
    }
        
    if(sol == 3){
        dfs(0,h,0,w,n);
    }
    
    if(sol == 4){
        int tmp3232 = ask(0,0,31,31);
        dfs(0,32,0,32,tmp3232);

        int tmp3218 = ask(0,32,31,49);
        //dfs(0,32,32,50,tmp3218);
        int tmp3216 = ask(0,32,31,47);
        dfs(0,32,32,48,tmp3216);
        dfs(0,32,48,50,tmp3218-tmp3216);
        int tmp1832 = ask(32,0,49,31);
        // dfs(32,50,0,32,tmp1832);
        int tmp1632 = ask(32,0,47,31);
        dfs(32,48,0,32,tmp1632);
        dfs(48,50,0,32,tmp1832-tmp1632);
        int amari = n-tmp3232-tmp3218-tmp1832;
        //dfs(32,50,32,50,amari);

        int tmp1616 = ask(32,32,47,47);
        dfs(32,48,32,48,tmp1616);
        int tmp1602 = ask(32,48,47,49);
        dfs(32,48,48,50,tmp1602);
        int tmp0216 = ask(48,32,49,47);
        dfs(48,50,32,48,tmp0216);
        int amariamari = amari-tmp1616-tmp1602-tmp0216;
        dfs(48,50,48,50,amariamari);
    }



    // 愚直
    int cnt = 0;
    rep(i,h){
        rep(j,w){
            if(a[i][j] == 1){
                cnt++;
                if(cnt == n)break;
                continue;
            }
            if(a[i][j] == -1){
                cout << "? " << i << " " << j << " " << i << " " << j << endl << flush;
                int res;
                cin >> res;
                a[i][j] = res;
                cnt += a[i][j];
            }
            if(cnt == n)break;
        }
        if(cnt == n)break;
    }

    // ans出力
    ll ans = 0;
    rep(i,h){
        rep(j,w){
            if(a[i][j]==1)ans = (ans + mod_pow(2,i*w+j,K)) % K;
        }
    }
    cout << "! " << ans << endl << flush;
    return 0;
}




Measured memory_bytes: 3784