#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<ll,ll>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e2 + 2;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;

ll a[2], o, f, s, p, x, y;
int main()
{
    TIME;
    cin >> x >> y;
    cout << "? 0 0" << endl;
    cin >> o;
    if( o == 0 )
        o = 1;
    if( o == -1 )
        p = 1;
    for( int i = 29; i >= 0; i -- )
    {
        a[p] += (1 << i);
        cout << "? " << a[0] << " " << a[1] << endl;
        cin >> f;
        a[p] -= (1 << i);
        cout << "? " << a[0] + (1 << i) << " " << a[1] + (1 << i) << endl;
        cin >> s;
        if( f == 0 )
            a[p] += (1 << i);
        if( f == o && s == -o )
            a[p] += (1 << i);
        if( f == -o && s == 0 )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == o )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == -o )
            a[p] += (1 << i), p = (1 - p), o = -o;
    }
    cout << "! " << a[0] << " " << a[1] << endl;
}


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<ll,ll>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e2 + 2;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;

int a[2], o, f, s, p;
int main()
{
    TIME;
    cout << "? 0 0" << endl;
    cin >> o;
    if( o == 0 )
        o = 1;
    if( o == -1 )
        p = 1;
    for( int i = 29; i >= 0; i -- )
    {
        a[p] += (1 << i);
        cout << "? " << a[0] << " " << a[1] << endl;
        cin >> f;
        a[p] -= (1 << i);
        cout << "? " << a[0] + (1 << i) << " " << a[1] + (1 << i) << endl;
        cin >> s;
        if( f == 0 )
            a[p] += (1 << i);
        if( f == o && s == -o )
            a[p] += (1 << i);
        if( f == -o && s == 0 )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == o )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == -o )
            a[p] += (1 << i), p = (1 - p), o = -o;
    }
    cout << "! " << a[0] << " " << a[1] << endl;
}


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<ll,ll>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e2 + 2;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;

int a[2], o, f, s, p;
int main()
{
    TIME;
    cout << "? 0 0" << endl;
    cin >> o;
    if( o == -1 )
        p = 1;
    else
        p = 0;
    for( int i = 29; i >= 0; i -- )
    {
        a[p] += (1 << i);
        cout << "? " << a[0] << " " << a[1] << endl;
        cin >> f;
        a[p] -= (1 << i);
        cout << "? " << a[0] + (1 << i) << " " << a[1] + (1 << i) << endl;
        cin >> s;
        if( f == 0 )
            a[p] += (1 << i);
        if( f == o && s == -o )
            a[p] += (1 << i);
        if( f == -o && s == 0 )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == o )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == -o )
            a[p] += (1 << i), p = (1 - p);
    }
    cout << "! " << a[0] << " " << a[1] << endl;
}


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<ll,ll>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e2 + 2;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;

int a[2], o, f, s, p, x, y;
int main()
{
    TIME;
    cin >> x >> y;
    cout << "? 0 0" << endl;
    func( o, 0, 0 );
    cout << o << endl;
    if( o == -1 )
        p = 1;
    else
        p = 0;
    for( int i = 4; i >= 0; i -- )
    {
        a[p] += (1 << i);
        cout << "? " << a[0] << " " << a[1] << endl;
        cin >> f;
        a[p] -= (1 << i);
        cout << "? " << a[0] + (1 << i) << " " << a[1] + (1 << i) << endl;
        cin >> s;
        if( f == 0 )
            a[p] += (1 << i);
        if( f == o && s == -o )
            a[p] += (1 << i);
        if( f == -o && s == 0 )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == o )
            a[0] += (1 << i), a[1] += (1 << i);
        if( f == -o && s == -o )
            a[p] += (1 << i), p = (1 - p), o = -o;
    }
    cout << "! " << a[0] << " " << a[1] << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a|(1<<i);//a1000
        tempb=b|(1<<i);//b1000
        ///f是大小结果
        ///temp1是比较（a1000 b0000）的结果
        ///temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){//这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else {//这一位不同(1/0)
            if(f>=0)a=tempa;///a>=b
            else b=tempb;
            ///判断目前a,b大小 不能用ask
            f=temp1;
            ///发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    //cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a+(1<<i);//a1000
        tempb=b+(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else if(temp1==temp2){///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    //cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(ll i=29;i>=0;i--){
        tempa=a+(1<<i);//a1000
        tempb=b+(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else {///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %lld %lld\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a|(1<<i);//a1000
        tempb=b|(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else {///这一位不同(1/0)
            if(f>=0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(ll i=29;i>=0;i--){
        tempa=a+(1<<i);//a1000
        tempb=b+(1<<i);//b1000
        //f是大小结果 temp1是比较（a1000 b0000）的结果 temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else if(temp1==temp2){///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %lld %lld\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    //cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(ll i=29;i>=0;i--){
        tempa=a+(1<<i);//a1000
        tempb=b+(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else if(temp1==temp2){///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %lld %lld\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    //cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a+(1<<i);//a1000
        tempb=b+(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else {///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include <iostream>
using namespace std;
int ask(int c,int d)
{
	cout << "? " << c << ' ' << d << endl;
	int ans;
	cin >> ans;
	return ans;
}
int main()
{
	cout.flush();
	int a=0,b=0,big=ask(0,0);
	for (int i=29;i>=0;i--)
	{
		int f=ask(a^(1<<i),b),s=ask(a,b^(1<<i));
		if (f==s)
		{
			if (big==1)
			a^=(1<<i);
			else
			b^=(1<<i);
			big=f;
		}
		else if (f==-1)
		{
			a^=(1<<i);
			b^=(1<<i);
		}
	}
	cout << "! " << a << ' ' << b << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(a,b);//初始判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a+(1<<i);
        tempb=b+(1<<i);
        ///f是前一个结果
        ///temp是后一个结果
        int temp=ask(tempa,tempb);
        if(temp*f>=0){
            if(f>=0){
                int p=ask(tempa,b);
                if(p<0){//避免前面的1对后面造成影响
                    a=tempa;
                    b=tempb;
                }
            }
            else{
                int p=ask(a,tempb);//a 10...    b 01...
                if(p>0){//避免前面的1对后面造成影响
                    a=tempa;
                    b=tempb;
                }
            }
        }
        else {
            if(f>0)a=tempa;
            else b=tempb;
            f=ask(a,b);
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const double eps=1e-9;
const int inf=1e9;
const int maxn=1e5;
bool vis[maxn+5];
ll a[maxn+5];
ll b[maxn+5];
int ask(int a,int b){
    int res;
    printf("? %d %d\n",a,b);
    fflush(stdout);
    scanf("%d",&res);
    return res;
}
int main(){
    //cout.flush();
    ll n,m,t;
    int jud=0;
    ll  a=0,b=0,tempa,tempb;
    int f=ask(0,0);//判断a,b大小
    ///为了避免前面的1对后面造成影响，必须连续两位判断
    for(int i=29;i>=0;i--){
        tempa=a^(1<<i);//a1000
        tempb=b^(1<<i);//b1000
        //f是大小结果//temp1是比较（a1000 b0000）的结果//temp2是比较（a0000 b1000）的结果
        int temp1=ask(tempa,b);
        int temp2=ask(a,tempb);
        if(temp1==-1&&temp2==1){///这一位相同且a,b都是1
            a=tempa;
            b=tempb;
        }///若temp1==1&&temp2==-1，那么这一位相同且a,b都是0
        else if(temp1==temp2){///这一位不同(1/0)
            if(f>0)a=tempa;///a>=b
            else b=tempb;
            //判断目前a,b大小 不能用ask
            f=temp1;//发现temp1就是舍去当前位后，能判断a，b后面数值的大小
        }
    }
    printf("! %d %d\n",a,b);
    fflush(stdout);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    for(int i = 0;i < 30;i++)
    {
        if(re == 0)
        {
            if(ask(prea + (1 << i),preb) == -1)
            {
                prea += (1 << i);
                preb += (1 << i);
            }
        }
        else if(re == 1)
        {
            temp = ask(prea + (1 << i),preb + (1 << i));
            if(temp == -1)
            {
            	prea += (1 << i);
            	re = ask(prea,preb);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
        else
        {
        	temp = ask(prea + (1 << i),preb + (1 << i));
        	if(temp == 1)
            {
            	preb += (1 << i);
            	re = ask(prea,preb);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
    }
    printf("! %d %d\n",prea,preb);
    fflush(stdout);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    for(int i = 0;i < 30;i++)
    {
        if(re == 0)
        {
            if(ask(prea << 1|1,preb) == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
        }
        else if(re == 1 || re == -1)
        {
            temp = ask(prea << 1|1,preb << 1);
            if(temp == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
            else
            {
                if(re == 1)
                {
                    prea += 1 << i;
                }
                else
                {
                    preb += 1 << i;
                }
            }
            re = ask(prea,preb);
        }
    }
    printf("! %d %d\n",prea,preb);
    fflush(stdout);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    for(int i = 0;i < 30;i++)
    {
        if(re == 0)
        {
            if(ask(prea + 1 << i,preb) == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
        }
        else if(re == 1 || re == -1)
        {
            temp = ask(prea + 1 << i,preb);
            if(temp == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
            else
            {
                if(re == 1)
                {
                    prea += 1 << i;
                }
                else
                {
                    preb += 1 << i;
                }
            }
            re = ask(prea,preb);
        }
    }
    printf("! %d %d\n",prea,preb);
    fflush(stdout);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    int cnt = 30;
    while(cnt--)
    {
        if(re == 0)
        {
            if(ask(prea << 1|1,preb) == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
        }
        else if(re == 1 || re == -1)
        {
            temp = ask(prea << 1|1,preb << 1);
            if(temp == -1)
            {
                prea += 1 << i;
                preb += 1 << i;
            }
            else
            {
                if(re == 1)
                {
                    prea += 1 << i;
                }
                else
                {
                    preb += 1 << i;
                }
            }
            re = ask(prea,preb);
        }
    }
    printf("! %d %d\n",prea,preb);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    while(1)
    {
        if(re == 0)
        {
            if(ask(prea << 1|1,preb) == -1)
            {
                prea = prea << 1|1;
                preb = preb << 1|1;
            }
            else
            {
                prea = prea << 1;
                preb = preb << 1;
            }
        }
        else if(re == 1 || re == -1)
        {
            temp = ask(prea << 1|1,preb << 1);
            if(temp == -1)
            {
                prea = prea << 1|1;
                preb = preb << 1|1;
            }
            else if(temp == 1)
            {
                prea = prea << 1;
                preb = preb << 1;
            }
            else
            {
                if(re == 1)
                {
                    prea = prea << 1|1;
                    preb = preb << 1;
                }
                else
                {
                    prea = prea << 1;
                    preb = preb << 1|1;
                }
            }
            re = ask(prea,preb);
        }
    }
    printf("! %d %d\n",prea,preb);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    for(int i = 0;i < 30;i++)
    {
        if(re == 0)
        {
            if(ask(prea + (1 << i),preb) == -1)
            {
                prea += (1 << i);
                preb += (1 << i);
            }
        }
        else if(re == 1)
        {
            temp = ask(prea + (1 << i),preb + (1 << i));
            if(temp == -1)
            {
            	prea += (1 << i);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
        else
        {
        	temp = ask(prea + (1 << i),preb + (1 << i));
        	if(temp == 1)
            {
            	preb += (1 << i);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
    }
    printf("! %d %d\n",prea,preb);
    fflush(stdout);
    return 0;
}


#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 2005;
int ask(int c,int d)
{
    printf("? %d %d\n",c,d);
    fflush(stdout);
    int re;
    scanf("%d",&re);
    return re;
}
int main()
{
    int prea = 0,preb = 0;
    int re,temp;
    re = ask(prea,preb);
    for(int i = 29;i >= 0;i--)
    {
        if(re == 0)
        {
            if(ask(prea + (1 << i),preb) == -1)
            {
                prea += (1 << i);
                preb += (1 << i);
            }
        }
        else if(re == 1)
        {
            temp = ask(prea + (1 << i),preb + (1 << i));
            if(temp == -1)
            {
            	prea += (1 << i);
            	re = ask(prea,preb);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
        else
        {
        	temp = ask(prea + (1 << i),preb + (1 << i));
        	if(temp == 1)
            {
            	preb += (1 << i);
            	re = ask(prea,preb);
            }
            else
            {
            	if(ask(prea + (1 << i),preb) == -1)
	            {
	                prea += (1 << i);
	                preb += (1 << i);
	            }
            }
        }
    }
    printf("! %d %d\n",prea,preb);
    fflush(stdout);
    return 0;
}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f1 = 0, f2 = 0, c=0, d=0, big;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<a+(1<<i)<<" "<<a<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				a+=(1<<i);
			}
		}

		cout<<"! "<<a<<" "<<a<<endl;
		cout.flush();
	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>big;

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
			cout.flush();
			cin>>f1;
			cout<<"? "<<c<<" "<<d+(1<<i);
			cout.flush();
			cin>>f2;

			if(f1 == f2)
			{
				if(big==1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
				big = f1;
			}
			else
			{
				if(f1==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
		}

		if(1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
		}

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f = 0,c=0, d=0;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<c<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				c+=(1<<i);
			}
		}

		cout<<"! "<<c<<" "<<c<<endl;
		cout.flush();

	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>f;

		for(int i=4;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d+(1<<i)<<endl;
			cout.flush();
			cin>>x;
	//		cout<<c<<" -- "<<d<<endl;
			if(x==f || x==0)
			{	//cout<<"first"<<endl;
				cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
				cout.flush();
				cin>>y;
				if(y==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
			else
			{
				//cout<<"second"<<endl;
				if(x==-1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
			}
		}

		if(f==1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
		}
		else cout<<"! "<<d<<" "<<c<<endl;

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f = 0,c=0, d=0;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<c<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				c+=(1<<i);
			}
		}

		cout<<"! "<<a<<" "<<a<<endl;
		cout.flush();

	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>f;

		for(int i=4;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d+(1<<i)<<endl;
			cout.flush();
			cin>>x;
	//		cout<<c<<" -- "<<d<<endl;
			if(x==f || x==0)
			{	//cout<<"first"<<endl;
				cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
				cout.flush();
				cin>>y;
				if(y==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
			else
			{
				//cout<<"second"<<endl;
				if(x==-1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
			}
		}

		if(f==1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
		}
		else cout<<"! "<<d<<" "<<c<<endl;

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f = 0,c=0, d=0;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<c<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				c+=(1<<i);
			}
		}

		cout<<"! "<<c<<" "<<c<<endl;
		cout.flush();

	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>f;

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d+(1<<i)<<endl;
			cout.flush();
			cin>>x;
	//		cout<<c<<" -- "<<d<<endl;
			if(x==f || x==0)
			{	//cout<<"first"<<endl;
				cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
				cout.flush();
				cin>>y;
				if(y==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
			else
			{
				//cout<<"second"<<endl;
				if(x==-1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
			}
		}

		if(f==1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
		}
		else cout<<"! "<<d<<" "<<c<<endl;

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f1 = 0, f2 = 0, c=0, d=0, big;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<a+(1<<i)<<" "<<a<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				a+=(1<<i);
			}
		}

		cout<<"! "<<a<<" "<<a<<endl;
		cout.flush();
	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>big;

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
			cout.flush();
			cin>>f1;
			cout<<"? "<<c<<" "<<d+(1<<i);
			cout.flush();
			cin>>f2;

			if(f1 == f2)
			{
				if(big==1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
				big = f1;
			}
			else
			{
				if(f1==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
		}

		if(1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
			cout.flush();
		}

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f1 = 0, f2 = 0, c=0, d=0, big;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<a+(1<<i)<<" "<<a<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				a+=(1<<i);
			}
		}

		cout<<"! "<<a<<" "<<a<<endl;
		cout.flush();
	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>big;

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
			cout.flush();
			cin>>f1;
			cout<<"? "<<c<<" "<<d+(1<<i)<<endl;
			cout.flush();
			cin>>f2;

			if(f1 == f2)
			{
				if(big==1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
				big = f1;
			}
			else
			{
				if(f1==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
		}

		if(1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
			cout.flush();
		}

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


/*
Author Shivam
*/
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug		cout<<"##########3"<<endl
#define mod			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => ,

void solve()
{
	int x,y,a,b,f = 0,c=0, d=0;

	cout<<"? "<<0<<" "<<0<<endl;
	cout.flush();
	cin>>x;
	if(x==0)
	{

		rep(i,0,30)
		{
			cout<<"? "<<a+(1<<i)<<" "<<a<<endl;
			cout.flush();
			cin>>x;
			if(x==-1)
			{
				a+=(1<<i);
			}
		}

		cout<<"! "<<a<<" "<<a<<endl;
		cout.flush();

	}
	else
	{	cout<<"? "<<0<<" "<<0<<endl;
		cout.flush();
		cin>>f;

		for(int i=29;i>=0;i--)
		{
			cout<<"? "<<c+(1<<i)<<" "<<d+(1<<i)<<endl;
			cout.flush();
			cin>>x;

			if(x==f || x==0)
			{
				cout<<"? "<<c+(1<<i)<<" "<<d<<endl;
				cout.flush();
				cin>>y;
				if(y==-1)
				{
					c+=(1<<i);
					d+=(1<<i);
				}
			}
			else
			{
				if(x==1)
				{
					c+=(1<<i);
				}
				else d+=(1<<i);
			}
		}

		if(f==1)
		{
			cout<<"! "<<c<<" "<<d<<endl;
		}
		else cout<<"! "<<d<<" "<<c<<endl;

	}

}
int main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

		int t;
		t=1;
		while(t--)
		{
			solve();
		}

}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=-1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                check1+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=d[i];
                    h=1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                check2+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=d[i];
                    h=-1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0";
    fflush(stdout);
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=31;i<=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=-1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                check1+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=d[i];
                    h=1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                check2+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check2-=d[i];
                    h=-1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=-1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                check1+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check1-=d[i];
                    h=1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                check2+=d[i];
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check2-=d[i];
                    h=-1;
                }
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0";
    cout<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=31;i<=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d",check1,check2);
            cout<<flush;
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                cout<<flush;
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            cout<<flush;
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            cout<<flush;
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d",check1,check2);
        cout<<flush;
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d",check1,check2);
    cout<<flush;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=31;i<=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0";
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=31;i<=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d",check1,check2);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d",check1,check2);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d",check1,check2);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d",check1,check2);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d",check1,check2);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=-1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=31;i<=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=1;
                }
                else if(f==-1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,check,f,check1,check2,s,p,j,h;
long long checki=1073741823;
int d[35];
int pow(int j)
{
    p=1;
    for(s=1;s<=j-1;s++)
    {
        p*=2;
    }
    return p;
}
int main(){
    cout<<"? 0 0\n"<<flush;
    cin>>f;
    h=f;
    for(i=1;i<=31;i++)
    {
        d[i]=pow(i);
    }
    for(i=30;i>=2;i--)
    {
        if(h==-1)
        {
            check2+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==-1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check2-=2*d[i]-1;
                    check1-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                }
                else
                {
                    check2-=d[i]-1;
                    check1-=d[i]-1;
                    h=0;
                }
            }
            else if(f==1)
            {
                h=1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==1)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1+=d[i]-1;
                check2+=d[i]-1;
                printf("? %d %d\n",check1,check2);
                fflush(stdout);
                cin>>f;
                if(f==-1)
                {
                    check1-=2*d[i]-1;
                    check2-=d[i]-1;
                    h=-1;
                }
                else if(f==1)
                {
                    h=1;
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                }
                else
                {
                    check1-=d[i]-1;
                    check2-=d[i]-1;
                    h=0;
                }
            }
            else if(f==-1)
            {
                h=-1;
            }
            else if(f==0)
            {
                h=0;
            }
        }
        else if(h==0)
        {
            check1+=d[i];
            printf("? %d %d\n",check1,check2);
            fflush(stdout);
            cin>>f;
            if(f==1)
            {
                check1-=d[i];
            }
            else if(f==-1)
            {
                check2+=d[i];
            }
        }
    }
    if(h==0)
    {
        check1+=1;
        printf("? %d %d\n",check1,check2);
        fflush(stdout);
        cin>>f;
        if(f==1)
        {
            check1-=1;
        }
        else
        {
            check2+=1;
        }
    }
    else if(h==1)
    {
        check1+=1;
    }
    else
    {
        check2+=1;
    }
    printf("! %d %d\n",check1,check2);
    fflush(stdout);
    return 0;
}


#include <cstdio>

inline int query(int c, int d)
{
	printf("? %d %d\n", c, d);
	fflush(stdout);
	int ret; scanf("%d", &ret);
	return ret;
}
int main()
{
	int del = query(0, 0);
	int a = 0, b = 0;
	for (int i = 29; ~i; --i)
	{
		int d1 = query(a ^ (1 << i), b), d2 = (a, b ^ (1 << i));
		if (d1 == d2)
		{
			if (del > 0) a |= 1 << i;
			else b |= 1 << i;
			del = d1;
		}
		else
		{
			if (d1 < 0) a |= 1 << i, b |= 1 << i;
		}
	}
	printf("! %d %d\n", a, b);
	fflush(stdout);
	return 0;
}


#include <cstdio>

inline int query(int c, int d)
{
	printf("? %d %d\n", c, d);
	fflush(stdout);
	int ret; scanf("%d", &ret);
	return ret;
}
int main()
{
	int del = query(0, 0);
	int a = 0, b = 0;
	for (int i = 29; ~i; --i)
	{
		int d1 = query(a ^ (1 << i), b), d2 = query(a, b ^ (1 << i));
		if (d1 == d2)
		{
			if (del > 0) a |= 1 << i;
			else b |= 1 << i;
			del = d1;
		}
		else
		{
			if (d1 < 0) a |= 1 << i, b |= 1 << i;
		}
	}
	printf("! %d %d\n", a, b);
	fflush(stdout);
	return 0;
}


#include <cstdio>

inline int query(int c, int d)
{
	printf("? %d %d\n", c, d);
	fflush(stdout);
	int ret; scanf("%d", &ret);
	return ret;
}
int main()
{
	int del = query(0, 0);
	int a = 0, b = 0;
	for (int i = 29; ~i; --i)
	{
		int d1 = query(a ^ (1 << i), b), d2 = (a, b ^ (1 << i));
		if (d1 == d2)
		{
			if (del > 0) a |= 1 << i;
			else b |= 1 << i;
			del = d1;
		}
		else
		{
			if (d1 < 0) a |= 1 << i, b |= 1 << i;
		}
	}
	printf("! %d %d\n", a, b);
	return 0;
}


#include <cstdio>

inline int query(int c, int d)
{
	printf("? %d %d\n", c, d);
	fflush(stdout);
	int ret; scanf("%d", &ret);
	return ret;
}
int main()
{
	int del = query(0, 0);
	int a = 0, b = 0;
	for (int i = 29; ~i; --i)
	{
		int d1 = query(a ^ (1 << i), b), d2 = (a, b ^ (1 << i));
		if (d1 == d2)
		{
			if (del > 0) a |= 1 << i;
			else b |= 1 << i;
			del = d1;
		}
		else
		{
			if (d1 > 0) a |= 1 << i, b |= 1 << i;
		}
	}
	printf("! %d %d\n", a, b);
	return 0;
}


#include <cstdio>

inline int query(int c, int d)
{
	printf("? %d %d\n", c, d);
	fflush(stdout);
	int ret; scanf("%d", &ret);
	return ret;
}
int main()
{
	int del = query(0, 0);
	int a = 0, b = 0;
	for (int i = 2; ~i; --i)
	{
		int d1 = query(a ^ (1 << i), b), d2 = query(a, b ^ (1 << i));
		if (d1 == d2)
		{
			if (del > 0) a |= 1 << i;
			else b |= 1 << i;
			del = d1;
		}
		else
		{
			if (d1 < 0) a |= 1 << i, b |= 1 << i;
		}
	}
	printf("! %d %d\n", a, b);
	fflush(stdout);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o){
			dif ^= 1 << i;
		}
		o = c;
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), dif ^ (1 << i));
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o){
			dif ^= 1 << i;
		}
		o = c;
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), (1 << i));
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o){
			dif ^= 1 << i;
			if(c == 1){
				o = -1;
			}
			else{
				o = 1;
			}
		}
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), 0);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o){
			dif ^= 1 << i;
		}
		o = c;
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0 && o; i--){
		printf("? %d %d\n", dif ^ (1 << i), (1 << i));
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 0) break;
		if(c != o && c != 0){
			dif ^= 1 << i;
			if(c == 1){
				o = -1;
			}
			else{
				o = 1;
			}
		}
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o && c != 0){
			dif ^= 1 << i;
		}
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;

	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif ^ (1 << i), 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c != o && c != 0){
			dif ^= 1 << i;
		}
		o = c;
	}

	int b = 0;
	for(int i = 29; i >= 0; i--){
		printf("? %d %d\n", dif, 1 << i);
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 1){
			b ^= 1 << i;
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define ff first
#define ss second
#define pb push_back

const int N = 100005;

int main(){
	int o;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &o);

	int dif = 0;
	int b = 0;

	for(int i = 29; i >= 0 && o; i--){
		printf("? %d %d\n", dif ^ (1 << i), (1 << i));
		fflush(stdout);
		int c;
		scanf("%d", &c);
		if(c == 0) break;
		if(c != o && c != 0){
			dif ^= 1 << i;
			printf("? %d %d\n", dif, 0);
			fflush(stdout);
			scanf("%d", &o);
			if(c == 1){
				b ^= 1 << i;
			}
		}
	}

	for(int i = 29; i >= 0; i--){
		if(!(dif & (1 << i))){
			printf("? %d %d\n", dif, 1 << i);
			fflush(stdout);
			int c;
			scanf("%d", &c);
			if(c == 1){
				b ^= 1 << i;
			}
		}
	}
	printf("! %d %d\n", b ^ dif, b);
	return 0;
}


#include"bits/stdc++.h"
using namespace std;
typedef long long LL;
const int inf=0x3f3f3f3f;
int main(){
    printf("! 3 1\n");
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
int flag,a,b,c,d,e,x,y;
int main(){
    puts("? 0 0");
    fflush(stdout);
    scanf("%d",&flag);
    for(int i=29;i>=0;i--){
        e=1<<i;
        printf("? %d %d\n",c+e,d);
        fflush(stdout);
        scanf("%d",&x);
        printf("? %d %d\n",c,d+e);
        fflush(stdout);
        scanf("%d",&y);
        if(x==y){
            if(flag==1)a|=e,d|=e;
            else b|=e,c|=e;
            flag=x;
        }
        else {
            if((flag==1&&y)||(flag==-1&&x))
            a|=1<<i;b|=1<<i;
        }
    }
    printf("! %d %d\n",a,b);
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
typedef long long LL;
const int inf=0x3f3f3f3f;
int a,b,c,d,x,y,f;
void read(int &x){
    fflush(stdout);
    scanf("%d",&x);
}
int main(){
    puts("? 0 0");
    read(f);
    for(int i=29;i>=0;i--){
        int j=1<<i;
        printf("? %d %d\n",c+j,d);
        read(x);
        printf("? %d %d\n",c,d+j);
        read(y);
        if(x!=y){
            if(y==1){
                a|=j;
                b|=j;
            }
        }
        else {
            if(f==1){
                a|=j;
                d|=j;
            }
            else {
                b|=j;
                c|=j;
            }
            f=x;
        }
    }
    printf("! %d %d\n",a,b);
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
typedef long long LL;
const int inf=0x3f3f3f3f;
int a,b,c,d,x,y,f;
void read(int &x){
    fflush(stdout);
    scanf("%d",&x);
}
int main(){
    puts("? 0 0");
    read(f);
    for(int i=29;i>=0;i--){
        int j=1<<i;
        printf("! %d %d\n",c+j,d);
        read(x);
        printf("! %d %d\n",c,d+j);
        read(y);
        if(x!=y){
            if(y==1){
                a|=j;
                b|=j;
            }
        }
        else {
            if(f==1){
                a|=j;
                d|=j;
            }
            else {
                b|=j;
                c|=j;
            }
            f=x;
        }
        printf("! %d %d\n",a,b);
    }
    return 0;
}


#include"bits/stdc++.h"
using namespace std;
typedef long long LL;
const int inf=0x3f3f3f3f;
int a,b,c,d,x,y,f;
void read(int &x){
    fflush(stdout);
    scanf("%d",&x);
}
int main(){
    puts("? 0 0");
    read(f);
    for(int i=29;i>=0;i++){
        int j=1<<i;
        printf("! %d %d\n",c+j,d);
        read(x);
        printf("! %d %d\n",c,d+j);
        read(y);
        if(x!=y){
            if(y==1){
                a|=j;
                b|=j;
            }
        }
        else {
            if(f==1){
                a|=j;
                d|=j;
            }
            else {
                b|=j;
                c|=j;
            }
            f=x;
        }
        printf("! %d %d\n",a,b);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x,a,b;
bool sw;
map<int,map<int,int>> mp;
void out(int a,int b)
{
    if(mp[a][b]>0) x=mp[a][b]-10;
    else
    {
        cout<<"? "<<a<<" "<<b<<endl;
        cin>>x;mp[a][b]=x+10;
    }
}
main()
{
   // freopen("42.inp","r",stdin);
    ROF(i,1,30)
    {
        out(a,b);
        if(x==1||x==0)
        {
            out(on(a,i),on(b,i));
            if(x==-1) a=on(a,i);
            else
            {
                out(a,on(b,i));
                if(x!=-1) a=on(a,i),b=on(b,i);
            }
        }
        else
        {
            out(on(a,i),on(b,i));
            if(x==1) a=on(a,i);
            else
            {
                out(a,on(b,i));
                if(x!=1) a=on(a,i),b=on(b,i);
            }
        }
    }
    cout<<"! "<<a<<" "<<b<<endl;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x,a,b;
bool sw;
map<int,map<int,int>> mp;
void out(int a,int b)
{
    if(mp[a][b]>0) x=mp[a][b]-10;
    else
    {
        cout<<"? "<<a<<" "<<b<<endl;
        cin>>x;mp[a][b]=x+10;
    }
}
main()
{
   // freopen("42.inp","r",stdin);
    ROF(i,1,30)
    {
        out(a,b);
        if(x==1||x==0)
        {
            out(on(a,i),on(b,i));
            if(x==-1) a=on(a,i);
            else
            {
                out(a,on(b,i));
                if(x!=-1) a=on(a,i),b=on(b,i);
            }
        }
        else
        {
            out(on(a,i),on(b,i));
            if(x==1) b=on(b,i);
            else
            {
                out(on(a,i),b);
                if(x!=1) a=on(a,i),b=on(b,i);
            }
        }
    }
    cout<<"! "<<a<<" "<<b<<endl;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x;
bool sw;

void out(int x,int y)
{
    if(!sw) cout<<"? "<<x<<" "<<y<<endl;
    else cout<<"? "<<y<<" "<<x<<endl;
}
int nhap_x()
{
    cin>>x;
    if(sw)
    {
        if(x==-1) return 1;
        if(x==0) return 0;
        if(x==1) return -1;
    }
    else return x;
}
main()
{
   // freopen("42.inp","r",stdin);
   int c=0,d=0;
    cout<<"? 0 0"<<endl;
    cin>>x;if(x==-1) sw=true;

    ROF(i,1,29)
    {
        out(on(c,i),on(d,i));
        int x=nhap_x();

        if(x==1||x==0)
        {
            out(c,on(d,i));
            if(nhap_x()==-1) {}
            else c=on(c,i),d=on(d,i);
        }
        else c=on(c,i);
    }
    if(!sw) cout<<"! "<<c<<" "<<d<<endl;
    else cout<<"! "<<d<<" "<<c<<endl;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x,a,b;
bool sw;
map<int,map<int,int>> mp;
void out(int a,int b)
{
    if(mp[a][b]>0) x=mp[a][b]-10;
    else
    {
        cout<<"? "<<a<<" "<<b<<endl;
        cin>>x;mp[a][b]=x+10;
    }
}
main()
{
   // freopen("42.inp","r",stdin);
    ROF(i,1,30)
    {
        out(a,b);
        if(x==1||x==0)
        {
            out(on(a,i),on(b,i));
            if(x==-1) a=on(a,i);
            else
            {
                out(a,on(b,i));
                cin>>x;
                if(x!=-1) a=on(a,i),b=on(b,i);
            }
        }
        else
        {
            out(on(a,i),on(b,i));
            if(x==1) a=on(a,i);
            else
            {
                out(a,on(b,i));
                if(x!=1) a=on(a,i),b=on(b,i);
            }
        }
    }
    cout<<"! "<<a<<" "<<b<<endl;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x;
bool sw;

void out(int x,int y)
{
    if(!sw) cout<<"? "<<x<<" "<<y<<endl;
    else cout<<"? "<<y<<" "<<x<<endl;
}
int nhap_x()
{
    cin>>x;
    if(sw)
    {
        if(x==-1) return 1;
        if(x==0) return 0;
        if(x==1) return -1;
    }
    else return x;
}
main()
{
   // freopen("42.inp","r",stdin);
   int c=0,d=0;
    cout<<"? 0 0"<<endl;
    cin>>x;if(x==-1) sw=true;

    ROF(i,1,3)
    {
        out(on(c,i),on(d,i));
        int x=nhap_x();

        if(x==1||x==0)
        {
            out(c,on(d,i));
            if(nhap_x()==-1) {}
            else c=on(c,i),d=on(d,i);
        }
        else c=on(c,i);
    }
    if(!sw) cout<<"! "<<c<<" "<<d<<endl;
    else cout<<"! "<<d<<" "<<c<<endl;
}


#include<bits/stdc++.h>
using namespace std;
inline long long in()
{
    long long x=0,n=0;char c=getchar();
    for(;!isdigit(c);c=getchar()) n=(c=='-');
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return n?-x:x;
}
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=b;a<=i;i--)
#define VEC(i,j,a) for(int i=0,_=0;i<a.size();_++) for(auto&j=a[i];__==i;i++)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
int x;
bool sw;

void out(int x,int y)
{
    if(!sw) cout<<"? "<<x<<" "<<y<<endl;
    else cout<<"? "<<y<<" "<<x<<endl;
}
int nhap_x()
{
    cin>>x;
    if(sw)
    {
        if(x==-1) return 1;
        if(x==0) return 0;
        if(x==1) return -1;
    }
    else return x;
}
main()
{
   // freopen("42.inp","r",stdin);
   int c=0,d=0;
    cout<<"? 0 0"<<endl;
    cin>>x;if(x==-1) sw=true;

    ROF(i,1,30)
    {
        out(on(c,i),on(d,i));
        int x=nhap_x();

        if(x==1||x==0)
        {
            out(c,on(d,i));
            if(nhap_x()==-1) {}
            else c=on(c,i),d=on(d,i);
        }
        else c=on(c,i);
    }
    if(!sw) cout<<"! "<<c<<" "<<d<<endl;
    else cout<<"! "<<d<<" "<<c<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int ask(int c, int d){
    cout  << c << " "<< d<<endl;
    fflush(stdout);
    cin >> c;
    return c;
}
void res(int c , int d){
    cout << "! " << c << " " << d << endl;
}
int main(){
    int A =0 , B=0;
    int mainAsk = -2;
    for(int i = 2 ; i >= 0 ; i--){
        if(mainAsk == -2) mainAsk = ask(A,B);
        int save=mainAsk;
        if(mainAsk==0){
            // equal
            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B);
            if(Ask == -1) {
                A = A | (1<<i) , B = B | (1<<i);
            }
            mainAsk = save;
        }
        else if(mainAsk==1){
            // a is greater

            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == -1) A = A | (1<<i);
            else if(Ask==1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == 1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
        else {
            mainAsk = -2;
            // b is greater
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == 1) A = A | (1<<i);
            else if(Ask== -1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == -1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
    }
    res(A,B);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int ask(int c, int d){
    cout  << c << " "<< d<<endl;
    fflush(stdout);
    cin >> c;
    return c;
}
void res(int c , int d){
    cout << "! " << c << " " << d << endl;
}
int main(){
    int A =0 , B=0;
    int mainAsk = -2;
    for(int i = 29 ; i >= 0 ; i--){
        if(mainAsk == -1) mainAsk = ask(A,B);
        int save=mainAsk;
        if(mainAsk==0){
            // equal
            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B);
            if(Ask == -1) {
                A = A | (1<<i) , B = B | (1<<i);
            }
            mainAsk = save;
        }
        else if(mainAsk==1){
            // a is greater

            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == -1) A = A | (1<<i);
            else if(Ask==1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == 1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
        else {
            mainAsk = -2;
            // b is greater
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == 1) A = A | (1<<i);
            else if(Ask== -1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == -1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
    }
    res(A,B);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int ask(int c, int d){
    cout  <<"? "<< c << " "<< d<<endl;
    fflush(stdout);
    cin >> c;
    return c;
}
void res(int c , int d){
    cout << "! " << c << " " << d << endl;
}
int main(){
    int A =0 , B=0;
    int mainAsk = -2;
    for(int i = 29 ; i >= 0 ; i--){
        if(mainAsk == -2) mainAsk = ask(A,B);
        int save=mainAsk;
        if(mainAsk==0){
            // equal
            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B);
            if(Ask == -1) {
                A = A | (1<<i) , B = B | (1<<i);
            }
            mainAsk = save;
        }
        else if(mainAsk==1){
            // a is greater

            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == -1) A = A | (1<<i);
            else if(Ask==1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == -1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
        else {
            mainAsk = -2;
            // b is greater
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == 1) A = A | (1<<i);
            else if(Ask== 1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == 1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
    }
    res(A,B);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int ask(int c, int d){
    cout  <<"? "<< c << " "<< d<<endl;
    fflush(stdout);
    cin >> c;
    return c;
}
void res(int c , int d){
    cout << "! " << c << " " << d << endl;
}
int main(){
    int A =0 , B=0;
    int mainAsk = -2;
    for(int i = 29 ; i >= 0 ; i--){
        if(mainAsk == -2) mainAsk = ask(A,B);
        int save=mainAsk;
        if(mainAsk==0){
            // equal
            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B);
            if(Ask == -1) {
                A = A | (1<<i) , B = B | (1<<i);
            }
            mainAsk = save;
        }
        else if(mainAsk==1){
            // a is greater

            mainAsk = -2;
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == -1) A = A | (1<<i);
            else if(Ask==1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == -1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
        else {
            mainAsk = -2;
            // b is greater
            int Ask = ask(A|(1<<i) , B |(1<<i));
            if(Ask == 1) A = A | (1<<i);
            else if(Ask== -1){
                int Ask = ask(A|(1<<i) , B);
                if(Ask == 1) {
                    A = A | (1<<i) , B = B | (1<<i);
                }
                mainAsk = save;
            }
            else assert(false);
        }
    }
    res(A,B);
    return 0;
}