#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<"\n";
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<10000005*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
#define EPS 1e-18
const long long N = 1e5+5;
vll visit,dist,taken;
vector<vll> adj;
vector<vii> adj2;
priority_queue<ii,vector<ii>, greater<ii> > pq;
ll bit[N];
ll an[N][35];
ll depth[N]={0};
ll siz;
ll res = 0;
ll lcm(ll a,ll b){return (a * b) / __gcd(a,b);}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll power(ll a,ll b){if(b == 0)return 1;if(b == 1)return a;ll ans = power(a,b/2) % MOD;ans *= ans;ans %= MOD;if(b % 2 == 1)ans *= a;return ans%MOD;}
ll inverse(ll x){x%=MOD;return power(x,MOD-2);}
void BITup(ll k, ll x){while(k <= siz){bit[k]+=x;k += k & -k;}}
ll BITq(ll k){ll s=0;while(k>=1){s+=bit[k];k -= k &-k;}return s;}
struct point{ll x,y,idx;};
void dfs(ll v){visit[v] = 1;for(auto x:adj[v]){if(!visit[x])dfs(x);}}
void bfs(ll s){visit[s] = 1;queue<ll>q;q.push(s);while(!q.empty()){ll u = q.front();ps(u);q.pop();for(auto x:adj[u]){if(!visit[x]){visit[x] = 1;q.push(x);}}}}
void dijkstra(ll s){pq.push(ii(0,s));dist[s] = 0;while(!pq.empty()){ii f = pq.top();pq.pop();ll w = f.F;ll u = f.S;if(w > dist[u]){continue;}for(auto v:adj2[u]){if(dist[u] + v.S < dist[v.F]){dist[v.F] = dist[u] + v.S;pq.push(ii(dist[v.F],v.F));}}}}
void prim(ll edge) {taken[edge] = 1;for(auto v:adj2[edge]) {if (taken[v.first]==0)pq.push(ii(v.second, v.first));}}
ll mst(ll s){taken.assign(N, 0);prim(s);ll cost = 0;while(!pq.empty()){ii front = pq.top();pq.pop();ll w = front.first;ll u = front.second;if(taken[u]==0)cost += w;prim(u);}return cost;}
void bfs01(ll s){deque<ll>q;dist[s] = 0;q.push_back(s);while(!q.empty()){ll v = q.front();q.pop_front();for(auto x:adj2[v]){if(dist[x.F] > dist[v] + x.S){dist[x.F] = dist[v] + x.S;if(x.S == 0){q.push_front(x.F);}else{q.push_back(x.F);}}}}}
void build(ll s,ll p){an[s][0] = p;f(i,1,35){an[s][i] = an[an[s][i-1]][i-1];}for(auto x:adj[s]){if(x != p){depth[x] = depth[s] + 1;build(x,s);}}}
ll kth(ll x,ll k){ll ans = x;if(depth[x] < k){return -1;}ll pos = 0;while(k > 0){if(k % 2){ans = an[ans][pos];}pos++;k /= 2;}return ans;}
ll lca(ll a,ll b){if(depth[a] > depth[b]){swap(a,b);}b = kth(b,abs(depth[a] - depth[b]));if(a == b){return a;}for(ll i = 34;i >= 0;i--){if(an[a][i] == an[b][i]){continue;}a = an[a][i];b = an[b][i];}return an[a][0];}
void YESNO(ll a){if(!!a){pl("YES");}else{pl("NO");}}
void filesin(void){freopen("tracing.in","r",stdin);}
void filesout(void){freopen("tracing.out","w",stdout);}
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Testing bot
bool ask(ll x,ll y){
    cout<<"? "<<x<<" "<<y<<endl;
    char c;
    cin>>c;
    return (c == 'x');
}
int main(void){
    fastio;
    string s;
    cin>>s;
    while(s == "start"){
        ll l = 0,r = 1;
        f(i,0,31){
            r = (1LL<<i);
            if(ask(l,r)){
                break;
            }
            l = r;
        }
        l++;
        ll ans = 0;
        ll ori = l;
        while(l <= r){
            ll mid = (l+r)/2;
            if(ask(ori,mid)){
                r = mid - 1;
            }
            else{
                l = mid + 1;
            }
        }
        cout<<"! "<<l<<endl;
        cin>>s;
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<"\n";
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<10000005*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
#define EPS 1e-18
const long long N = 1e5+5;
vll visit,dist,taken;
vector<vll> adj;
vector<vii> adj2;
priority_queue<ii,vector<ii>, greater<ii> > pq;
ll bit[N];
ll an[N][35];
ll depth[N]={0};
ll siz;
ll res = 0;
ll lcm(ll a,ll b){return (a * b) / __gcd(a,b);}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll power(ll a,ll b){if(b == 0)return 1;if(b == 1)return a;ll ans = power(a,b/2) % MOD;ans *= ans;ans %= MOD;if(b % 2 == 1)ans *= a;return ans%MOD;}
ll inverse(ll x){x%=MOD;return power(x,MOD-2);}
void BITup(ll k, ll x){while(k <= siz){bit[k]+=x;k += k & -k;}}
ll BITq(ll k){ll s=0;while(k>=1){s+=bit[k];k -= k &-k;}return s;}
struct point{ll x,y,idx;};
void dfs(ll v){visit[v] = 1;for(auto x:adj[v]){if(!visit[x])dfs(x);}}
void bfs(ll s){visit[s] = 1;queue<ll>q;q.push(s);while(!q.empty()){ll u = q.front();ps(u);q.pop();for(auto x:adj[u]){if(!visit[x]){visit[x] = 1;q.push(x);}}}}
void dijkstra(ll s){pq.push(ii(0,s));dist[s] = 0;while(!pq.empty()){ii f = pq.top();pq.pop();ll w = f.F;ll u = f.S;if(w > dist[u]){continue;}for(auto v:adj2[u]){if(dist[u] + v.S < dist[v.F]){dist[v.F] = dist[u] + v.S;pq.push(ii(dist[v.F],v.F));}}}}
void prim(ll edge) {taken[edge] = 1;for(auto v:adj2[edge]) {if (taken[v.first]==0)pq.push(ii(v.second, v.first));}}
ll mst(ll s){taken.assign(N, 0);prim(s);ll cost = 0;while(!pq.empty()){ii front = pq.top();pq.pop();ll w = front.first;ll u = front.second;if(taken[u]==0)cost += w;prim(u);}return cost;}
void bfs01(ll s){deque<ll>q;dist[s] = 0;q.push_back(s);while(!q.empty()){ll v = q.front();q.pop_front();for(auto x:adj2[v]){if(dist[x.F] > dist[v] + x.S){dist[x.F] = dist[v] + x.S;if(x.S == 0){q.push_front(x.F);}else{q.push_back(x.F);}}}}}
void build(ll s,ll p){an[s][0] = p;f(i,1,35){an[s][i] = an[an[s][i-1]][i-1];}for(auto x:adj[s]){if(x != p){depth[x] = depth[s] + 1;build(x,s);}}}
ll kth(ll x,ll k){ll ans = x;if(depth[x] < k){return -1;}ll pos = 0;while(k > 0){if(k % 2){ans = an[ans][pos];}pos++;k /= 2;}return ans;}
ll lca(ll a,ll b){if(depth[a] > depth[b]){swap(a,b);}b = kth(b,abs(depth[a] - depth[b]));if(a == b){return a;}for(ll i = 34;i >= 0;i--){if(an[a][i] == an[b][i]){continue;}a = an[a][i];b = an[b][i];}return an[a][0];}
void YESNO(ll a){if(!!a){pl("YES");}else{pl("NO");}}
void filesin(void){freopen("tracing.in","r",stdin);}
void filesout(void){freopen("tracing.out","w",stdout);}
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Testing bot
bool ask(ll x,ll y){
    cout<<"? "<<x<<" "<<y<<endl;
    char c;
    cin>>c;
    return (c == 'x');
}
int main(void){
    fastio;
    string s;
    cin>>s;
    while(s == "start"){
        ll l = 0,r = 1;
        f(i,0,31){
            r = (1LL<<i);
            if(ask(l,r)){
                break;
            }
            l = r;
        }
        //l++;
        ll ans = 0;
        ll ori = l;
        while(r - l > 1){
            ll mid = (l+r)/2;
            if(ask(ori,mid)){
                r = mid;
            }
            else{
                l = mid;
            }
        }
        cout<<"! "<<l+1<<endl;
        cin>>s;
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<"\n";
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<10000005*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
#define EPS 1e-18
const long long N = 1e5+5;
vll visit,dist,taken;
vector<vll> adj;
vector<vii> adj2;
priority_queue<ii,vector<ii>, greater<ii> > pq;
ll bit[N];
ll an[N][35];
ll depth[N]={0};
ll siz;
ll res = 0;
ll lcm(ll a,ll b){return (a * b) / __gcd(a,b);}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll power(ll a,ll b){if(b == 0)return 1;if(b == 1)return a;ll ans = power(a,b/2) % MOD;ans *= ans;ans %= MOD;if(b % 2 == 1)ans *= a;return ans%MOD;}
ll inverse(ll x){x%=MOD;return power(x,MOD-2);}
void BITup(ll k, ll x){while(k <= siz){bit[k]+=x;k += k & -k;}}
ll BITq(ll k){ll s=0;while(k>=1){s+=bit[k];k -= k &-k;}return s;}
struct point{ll x,y,idx;};
void dfs(ll v){visit[v] = 1;for(auto x:adj[v]){if(!visit[x])dfs(x);}}
void bfs(ll s){visit[s] = 1;queue<ll>q;q.push(s);while(!q.empty()){ll u = q.front();ps(u);q.pop();for(auto x:adj[u]){if(!visit[x]){visit[x] = 1;q.push(x);}}}}
void dijkstra(ll s){pq.push(ii(0,s));dist[s] = 0;while(!pq.empty()){ii f = pq.top();pq.pop();ll w = f.F;ll u = f.S;if(w > dist[u]){continue;}for(auto v:adj2[u]){if(dist[u] + v.S < dist[v.F]){dist[v.F] = dist[u] + v.S;pq.push(ii(dist[v.F],v.F));}}}}
void prim(ll edge) {taken[edge] = 1;for(auto v:adj2[edge]) {if (taken[v.first]==0)pq.push(ii(v.second, v.first));}}
ll mst(ll s){taken.assign(N, 0);prim(s);ll cost = 0;while(!pq.empty()){ii front = pq.top();pq.pop();ll w = front.first;ll u = front.second;if(taken[u]==0)cost += w;prim(u);}return cost;}
void bfs01(ll s){deque<ll>q;dist[s] = 0;q.push_back(s);while(!q.empty()){ll v = q.front();q.pop_front();for(auto x:adj2[v]){if(dist[x.F] > dist[v] + x.S){dist[x.F] = dist[v] + x.S;if(x.S == 0){q.push_front(x.F);}else{q.push_back(x.F);}}}}}
void build(ll s,ll p){an[s][0] = p;f(i,1,35){an[s][i] = an[an[s][i-1]][i-1];}for(auto x:adj[s]){if(x != p){depth[x] = depth[s] + 1;build(x,s);}}}
ll kth(ll x,ll k){ll ans = x;if(depth[x] < k){return -1;}ll pos = 0;while(k > 0){if(k % 2){ans = an[ans][pos];}pos++;k /= 2;}return ans;}
ll lca(ll a,ll b){if(depth[a] > depth[b]){swap(a,b);}b = kth(b,abs(depth[a] - depth[b]));if(a == b){return a;}for(ll i = 34;i >= 0;i--){if(an[a][i] == an[b][i]){continue;}a = an[a][i];b = an[b][i];}return an[a][0];}
void YESNO(ll a){if(!!a){pl("YES");}else{pl("NO");}}
void filesin(void){freopen("tracing.in","r",stdin);}
void filesout(void){freopen("tracing.out","w",stdout);}
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Testing bot
bool ask(ll x,ll y){
    cout<<"? "<<x<<" "<<y<<endl;
    char c;
    cin>>c;
    return (c == 'x');
}
int main(void){
    fastio;
    string s;
    cin>>s;
    while(s == "start"){
        ll l = 0,r = 1;
        f(i,0,31){
            r = (1LL<<i);
            if(ask(l,r)){
                break;
            }
            l = r;
        }
        l++;
        ll ans = 0;
        while(l <= r){
            ll mid = (l+r)/2;
            if(ask(l,mid)){
                l = mid + 1;
                ans = max(ans,mid);
            }
            else{
                r = mid - 1;
            }
        }
        cout<<"! "<<ans<<endl;
        cin>>s;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000010
const int N = 1010, M = 5;
char tmpread[N];

int ask(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf("%s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

void solve(){
	int low = 1, high = (int)1e9 , mid , cur , res = (int)1e9;
	while(high >= low){
		mid = (low + high) / 2;
		cur = ask((int)1e9 + mid,(int)1e9);
		if(cur == 0){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	printf("%d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf("%s",tmpread);
		if(tmpread[0] == 'e')
			break;
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000000
const int N = 1010, M = 5;
char tmpread[N];
int Res = 7;

int ask(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf(" %s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

vector< pair<int,int> > v;

void solve(){
	int low = 1, high = (int)1e9 , mid = 1 , cur , res = (int)1e9;
	while(high >= low){
		mid = (low + high) / 2;
		cur = ask(mid * 2, mid);
		if(cur == 0){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	v.clear();
	int po = 0;
	int tmp = res;
	for(int i = 2;i * i <= res;i++){
		po = 0;
		while(res % i == 0){
			res /= i;
			po++;
		}
		if(po != 0)
			v.push_back(make_pair(i , po));
	}
	if(res != 0)
		v.push_back(make_pair(res,1));
	res = tmp;
	for(int i = 0;i<(int)v.size();i++){
		for(int j = 0 ;j<(int)v[i].second;j++){
			res /= v[i].first;
			cur = ask(tmp , res);
			if(cur == 1){
				res *= v[i].first;
				break;
			}
		}
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf(" %s",tmpread);
		if(tmpread[0] == 'e')
			break;
		assert(tmpread[0] != 'm');
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000000
const int N = 1010, M = 5;
char tmpread[N];
int Res = 234;

int ask(int x,int y){
	/*if(x % Res >= y % Res)
		return 0;
	return 1;
	*/
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf(" %s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

vector< pair<int,int> > v;

void solve(){
	int cur = 1;
	if(ask(0 , cur) == 0){
		puts("! 1");
		fflush(stdout);
		return ;
	}
	while(true){
		if(ask(cur , cur * 2) == 0)
			break;
		cur *= 2;
	}
	int low = cur , high = cur * 2, res = cur , mid;
	while(high >= low){
		mid = (low + high) / 2;
		if(ask(mid , cur) == 1){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf("%s",tmpread);
		if(tmpread[0] == 's')
			solve();
		else
			break;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000010
const int N = 1010, M = 5;
char tmpread[N];
int Res = 4;

int ask(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf("%s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

void solve(){
	int low = 1, high = (int)1e9 , mid = 1 , cur , res = (int)1e9;
	while(high >= low){
		mid = (low + high) / 2;
		cur = ask(mid * 2, mid);
		if(cur == 0){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	vector < pair<int ,int > > v;
	int po = 0;
	int tmp = res;
	for(int i = 2;i * i <= res;i++){
		po = 0;
		while(res % i == 0){
			res /= i;
			po++;
		}
		if(po != 0)
			v.push_back(make_pair(i , po));
	}
	if(res != 0)
		v.push_back(make_pair(res,1));
	res = tmp;
	for(int i = 0;i<(int)v.size();i++){
		for(int j = 0 ;j<(int)v[i].second;j++){
			res /= v[i].first;
			cur = ask(tmp , res);
			if(cur == 1){
				res *= v[i].first;
				break;
			}
		}
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf("%s",tmpread);
		if(tmpread[0] == 'e')
			break;
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000000
const int N = 1010, M = 5;
char tmpread[N];
int Res = oo;

int ask(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf("%s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

vector< pair<int,int> > v;

void solve(){
	int low = 1, high = (int)1e9 , mid = 1 , cur , res = (int)1e9;
	while(high >= low){
		mid = (low + high) / 2;
		cur = ask(mid * 2, mid);
		if(cur == 0){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	v.clear();
	int po = 0;
	int tmp = res;
	for(int i = 2;i * i <= res;i++){
		po = 0;
		while(res % i == 0){
			res /= i;
			po++;
		}
		if(po != 0)
			v.push_back(make_pair(i , po));
	}
	if(res != 0)
		v.push_back(make_pair(res,1));
	res = tmp;
	for(int i = 0;i<(int)v.size();i++){
		for(int j = 0 ;j<(int)v[i].second;j++){
			res /= v[i].first;
			cur = ask(tmp , res);
			if(cur == 1){
				res *= v[i].first;
				break;
			}
		}
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf("%s",tmpread);
		if(tmpread[0] == 'e')
			break;
		if(tmpread[0] == 'm'){
			assert(false);
		}
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000000
const int N = 1010, M = 5;
char tmpread[N];
int Res = 7;

int ask(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf(" %s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

vector< pair<int,int> > v;

void solve(){
	int low = 1, high = (int)1e9 , mid = 1 , cur , res = (int)1e9;
	while(high >= low){
		mid = (low + high) / 2;
		cur = ask(mid * 2, mid);
		if(cur == 0){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	v.clear();
	int po = 0;
	int tmp = res;
	for(int i = 2;i * i <= res;i++){
		po = 0;
		while(res % i == 0){
			res /= i;
			po++;
		}
		if(po != 0)
			v.push_back(make_pair(i , po));
	}
	if(res != 1)
		v.push_back(make_pair(res,1));
	res = tmp;
	for(int i = 0;i<(int)v.size();i++){
		for(int j = 0 ;j<(int)v[i].second;j++){
			res /= v[i].first;
			cur = ask(tmp , res);
			if(cur == 1){
				res *= v[i].first;
				break;
			}
		}
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf(" %s",tmpread);
		if(tmpread[0] == 'e')
			break;
		assert(tmpread[0] != 'm');
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000000
const int N = 1010, M = 5;
char tmpread[N];
int Res ;

int ask(int x,int y){
	/*if(x % Res >= y % Res)
		return 0;
	return 1;
	*/
	printf("? %d %d\n",x,y);
	fflush(stdout);
	scanf(" %s",tmpread);
	if(tmpread[0] == 'e')
		assert(false);
	if(tmpread[0] == 'x')
		return 0;
	return 1;
}

vector< pair<int,int> > v;

void solve(){
	int cur = 1;
	if(ask(0 , cur) == 0){
		puts("! 1");
		fflush(stdout);
		return ;
	}
	while(true){
		if(ask(cur , cur * 2) == 0)
			break;
		cur *= 2;
	}
	int low = cur , high = cur * 2, res = cur * 2 , mid;
	while(high >= low){
		mid = (low + high) / 2;
		if(ask(mid , mid * 2)){
			res = mid;
			high = mid - 1;
		}
		else
			low = mid + 1;
	}
	printf("! %d\n",res);
	fflush(stdout);
}

int main(){
	while(true){
		scanf("%s",tmpread);
		if(tmpread[0] == 's')
			solve();
		else
			break;
	}
	return 0;
}


#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <list>
using namespace std;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x) // big bug here if "-x" is not surrounded by "()"
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};

void dane() {
	string s;
	while(cin>>s) {

	if(s == "mistake" || s == "end") {
		return;
	}

	cout<<"? 0 1\n";
	fflush(stdout);
	char aaa;
	cin>>aaa;
	if(aaa == 'x') {
		cout<<"! 1\n";
		fflush(stdout);
		continue;
	}

	int pocz = 1;
	int kon = 2;
	int plus = 0;
	while(pocz != kon) {
		cout<<"? "<<pocz+plus<<" "<<kon+plus<<"\n";
		fflush(stdout);
		char ans;
		cin>>ans;
		if(ans == 'e') {
			return;
		}
		if(ans == 'y')
			if(pocz>=536870912)
				break;
			pocz = kon;
			kon = pocz*2;
		} else {
			break;
		}
	}
	while(pocz != kon) {
				int half = pocz + (kon-pocz)/2;
				cout<<"? "<<half<<" "<<kon<<"\n";
				fflush(stdout);
				char ans;
				cin>>ans;
				if(ans == 'y') {
					kon = half;
				} else {
					pocz = half+1;
				}
			}
	cout<<"! "<<kon<<"\n";
	fflush(stdout);
	}
}

int main() {

	// ios_base::sync_with_stdio(0);cin.tie(0);
	// int t;
	// cin>>t;
	// F(i,0,t)
	dane();
    return 0;
}


#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <list>
using namespace std;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x) // big bug here if "-x" is not surrounded by "()"
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};

void dane() {
	string s;
	while(cin>>s) {

	if(s == "mistake" || s == "end") {
		return;
	}

	cout<<"? 0 1\n";
	fflush(stdout);
	char aaa;
	cin>>aaa;
	if(aaa == 'x') {
		cout<<"! 1\n";
		fflush(stdout);
		continue;
	}

	int pocz = 1;
	int kon = 2;
	int plus = 0;
	while(pocz != kon) {
		cout<<"? "<<pocz+plus<<" "<<kon+plus<<"\n";
		fflush(stdout);
		char ans;
		cin>>ans;
		if(ans == 'e') {
			return;
		}
		if(ans == 'y') {
			if(pocz>=536870912) {
				break;
			}
			pocz = kon;
			kon = pocz*2;
		} else {
			break;
		}
	}
	while(pocz != kon) {
				int half = pocz + (kon-pocz)/2;
				cout<<"? "<<half<<" "<<kon<<"\n";
				fflush(stdout);
				char ans;
				cin>>ans;
				if(ans == 'y') {
					kon = half;
				} else {
					pocz = half+1;
				}
			}
	cout<<"! "<<kon<<"\n";
	fflush(stdout);
	}
}

int main() {

	// ios_base::sync_with_stdio(0);cin.tie(0);
	// int t;
	// cin>>t;
	// F(i,0,t)
	dane();
    return 0;
}


#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <list>
using namespace std;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x) // big bug here if "-x" is not surrounded by "()"
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};

void dane() {
	string s;
	while(cin>>s) {

	if(s == "mistake" || s == "end") {
		return;
	}

	cout<<"? 0 1\n";
	fflush(stdout);
	char aaa;
	cin>>aaa;
	if(aaa == 'x') {
		cout<<"! 1\n";
		fflush(stdout);
		continue;
	}

	int pocz = 1;
	int kon = 2;
	int plus = 0;
	while(pocz != kon) {
		cout<<"? "<<pocz+plus<<" "<<kon+plus<<"\n";
		fflush(stdout);
		char ans;
		cin>>ans;
		if(ans == 'e') {
			return;
		}
		if(ans == 'y') {
			break;
			pocz = kon;
			kon = pocz*2;
		} else {

			break;
		}
	}
	while(pocz != kon) {
				int half = pocz + (kon-pocz)/2;
				cout<<"? "<<half<<" "<<kon<<"\n";
				fflush(stdout);
				char ans;
				cin>>ans;
				if(ans == 'y') {
					kon = half;
				} else {
					pocz = half+1;
				}
			}
	cout<<"! "<<kon<<"\n";
	fflush(stdout);
	}
}

int main() {

	// ios_base::sync_with_stdio(0);cin.tie(0);
	// int t;
	// cin>>t;
	// F(i,0,t)
	dane();
    return 0;
}


#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <list>
using namespace std;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x) // big bug here if "-x" is not surrounded by "()"
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};

void dane() {
	string s;
	while(cin>>s) {

	if(s == "mistake" || s == "end") {
		return;
	}

	cout<<"? 0 1\n";
	fflush(stdout);
	char aaa;
	cin>>aaa;
	if(aaa == 'x') {
		cout<<"! 1\n";
		fflush(stdout);
		continue;
	}

	int pocz = 1;
	int kon = 2;
	int plus = 0;
	while(pocz != kon) {
		cout<<"? "<<pocz+plus<<" "<<kon+plus<<"\n";
		fflush(stdout);
		char ans;
		cin>>ans;
		if(ans == 'e') {
			return;
		}
		if(ans == 'y') {

			pocz = kon;
			kon = pocz*2;
			if(pocz>=536870912) {
				break;
			}
		} else {
			break;
		}
	}
	while(pocz != kon) {
				int half = pocz + (kon-pocz)/2;
				cout<<"? "<<half<<" "<<kon<<"\n";
				fflush(stdout);
				char ans;
				cin>>ans;
				if(ans == 'y') {
					kon = half;
				} else {
					pocz = half+1;
				}
			}
	cout<<"! "<<kon<<"\n";
	fflush(stdout);
	}
}

int main() {

	// ios_base::sync_with_stdio(0);cin.tie(0);
	// int t;
	// cin>>t;
	// F(i,0,t)
	dane();
    return 0;
}


#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
#include <list>
using namespace std;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x) // big bug here if "-x" is not surrounded by "()"
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};

void dane() {
	string s;
	while(cin>>s) {

	if(s == "mistake" || s == "end") {
		return;
	}

	cout<<"? 0 1\n";
	fflush(stdout);
	char aaa;
	cin>>aaa;
	if(aaa == 'x') {
		cout<<"! 1\n";
		fflush(stdout);
		continue;
	}

	int pocz = 1;
	int kon = 2;
	int plus = 0;
	while(pocz != kon) {
		cout<<"? "<<pocz+plus<<" "<<kon+plus<<"\n";
		fflush(stdout);
		char ans;
		cin>>ans;
		if(ans == 'e') {
			return;
		}
		if(ans == 'y') {
			pocz = kon;
			kon = pocz*2;
		} else {
			while(pocz != kon) {
				int half = pocz + (kon-pocz)/2;
				cout<<"? "<<half<<" "<<kon<<"\n";
				fflush(stdout);
				cin>>ans;
				if(ans == 'y') {
					kon = half;
				} else {
					pocz = half+1;
				}
			}
			break;
		}
	}
	cout<<"! "<<kon<<"\n";
	fflush(stdout);
	}
}

int main() {

	// ios_base::sync_with_stdio(0);cin.tie(0);
	// int t;
	// cin>>t;
	// F(i,0,t)
	dane();
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class cmp = less <T1>> using Tree = tree <T1, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2> using um = unordered_map <T1, T2>;
template <class T> using us = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
const int L = 31;
int l, r, p = 1000000000;
string resp;

int query(int x, int y) {
    cout << "? " << x << " " << y << "\n";
    cout.flush();
    cin >> resp;
    // return x % p < y % p;
    return resp == "y";
}

void solve() {
    for(int i = 1, j = 1; i < L; ++i, j *= 2) {
        int x = query(j, 2 * j);
        if(x == 0) {
            l = j;
            r = j * 2;
            break;
        }
    }
    if(l == 1 && r == 2) {
        if(query(r, l) == 1) {
            cout << "! " << r << "\n";
        } else {
            cout << "! " << l << "\n";
        }
        cout.flush();
        return;
    }
    l++;
    while(l + 1 < r) {
        int q = l + r >> 1;
        int x = query(l - 1, q);
        if(x == 0) {
            r = q;
        } else {
            l = q + 1;
        }
    }
    if(query(r, l) == 1) {
        cout << "! " << r << "\n";
    } else {
        cout << "! " << l << "\n";
    }
    cout.flush();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    while(cin >> resp) {
        solve();
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class cmp = less <T1>> using Tree = tree <T1, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2> using um = unordered_map <T1, T2>;
template <class T> using us = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
const int L = 30;
int l, r;
string resp;

int query(int x, int y) {
    cout << "? " << x << " " << y << "\n";
    cout.flush();
    cin >> resp;
    return resp == "y";
}

void solve() {
    for(int i = 1, j = 1; i < L; ++i, j *= 2) {
        int x = query(j, 2 * j);
        if(x == 0) {
            l = j;
            r = j * 2;
            cout.flush();
            break;
        }
    }
    while(l + 1 < r) {
        int q = l + r >> 1;
        int x = query(l, q);
        if(x == 0) {
            r = q;
        } else {
            l = q + 1;
        }
    }
    if(query(r, l) == 1) {
        cout << "! " << r << "\n";
    } else {
        cout << "! " << l << "\n";
    }
    cout.flush();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    while(cin >> resp) {
        solve();
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class cmp = less <T1>> using Tree = tree <T1, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2> using um = unordered_map <T1, T2>;
template <class T> using us = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
const int L = 30;
int l, r;
string resp;

int query(int x, int y) {
    cout << "? " << x << " " << y << "\n";
    cout.flush();
    cin >> resp;
    return resp == "y";
}

void solve() {
    for(int i = 1, j = 1; i < L; ++i, j *= 2) {
        int x = query(j, 2 * j);
        if(x == 0) {
            l = j;
            r = j * 2;
            cout.flush();
            break;
        }
    }
    if(l == 1 && r == 2) {
        if(query(r, l) == 1) {
            cout << "! " << r << "\n";
        } else {
            cout << "! " << l << "\n";
        }
        return;
    }
    l++;
    while(l + 1 < r) {
        int q = l + r >> 1;
        int x = query(l - 1, q);
        if(x == 0) {
            r = q;
        } else {
            l = q + 1;
        }
    }
    if(query(r, l) == 1) {
        cout << "! " << r << "\n";
    } else {
        cout << "! " << l << "\n";
    }
    cout.flush();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    while(cin >> resp) {
        solve();
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class cmp = less <T1>> using Tree = tree <T1, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2> using um = unordered_map <T1, T2>;
template <class T> using us = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
string resp;

int query(int x, int y) {
    cout << "? " << x << " " << y << "\n";
    cout.flush();
    cin >> resp;
    return resp == "y";
}

bool test(int q) {
    return query(q, inf) == 0;
}

int bin_search(int l, int r) {
    if(l == r) {
        return l;
    }
    int q = l + r >> 1;
    if(test(q)) {
        return bin_search(l, q);
    } else {
        return bin_search(q + 1, r);
    }
}

void solve() {
    cout << "! " << bin_search(1, inf) - 1 << "\n";
    cout.flush();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    while(cin >> resp) {
        solve();
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class cmp = less <T1>> using Tree = tree <T1, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2> using um = unordered_map <T1, T2>;
template <class T> using us = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
const int L = 30;
int l, r;
string resp;

int query(int x, int y) {
    cout << "? " << x << " " << y << "\n";
    cout.flush();
    cin >> resp;
    return resp == "y";
}

void solve() {
    for(int i = 1, j = 1; i < L; ++i, j *= 2) {
        int x = query(j, 2 * j);
        if(x == 0) {
            l = j;
            r = j * 2;
            cout.flush();
            break;
        }
    }
    if(l == 1 && r == 2) {
        if(query(r, l) == 1) {
            cout << "! " << r << "\n";
        } else {
            cout << "! " << l << "\n";
        }
        cout.flush();
        return;
    }
    l++;
    while(l + 1 < r) {
        int q = l + r >> 1;
        int x = query(l - 1, q);
        if(x == 0) {
            r = q;
        } else {
            l = q + 1;
        }
    }
    if(query(r, l) == 1) {
        cout << "! " << r << "\n";
    } else {
        cout << "! " << l << "\n";
    }
    cout.flush();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    while(cin >> resp) {
        solve();
    }
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    for(string state; cin >> state && true; ){
        if(state == "start"){
            int l, r; l = 1, r = 1e9+1;
            while(l+1 < r){
                int mid = (l+r)/2;
                string rep = ask(mid, r);
                if(rep == "x") r = mid;
                else if(rep == "y") l = mid;
                else if(rep == "e") return -1;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else while(true);
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    cerr << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    // huh??
    for(string state; true; ){
        cin >> state;
        if(state == "start"){
            int l, r; l = 1, r = 1e9;
            for(int iter = 0; iter < 60 && l < r; iter++){
                int mid = l+(r-l+1>>1);
                string rep = ask(mid, r);
                if(rep == "x") r = mid-1;
                else if(rep == "y") l = mid;
                else if(rep == "e") return -1;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else while(true);
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    // huh??
    for(string state; true; ){
        cin >> state;
        if(state == "start"){
            int l, r; l = 1, r = 1e9+1;
            for(int iter = 0; iter < 60 && l+1 < r; iter++){
                int mid = (l+r)/2;
                string rep = ask(mid, r);
                if(rep == "x") r = mid;
                else if(rep == "y") l = mid;
                else if(rep == "e") return -1;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else while(true);
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    cerr << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    // huh??
    for(string state; true; ){
        cin >> state;
        if(state == "start"){
            int l, r; l = 1, r = 1e9+1;
            for(int iter = 0; iter < 60 && l+1 < r; iter++){
                int mid = (l+r)/2;
                string rep = ask(mid, r);
                if(rep == "x") r = mid;
                else if(rep == "y") l = mid;
                else if(rep == "e") return -1;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else while(true);
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    for(string state; cin >> state && true; ){
        if(state == "start"){
            int l, r; l = 1, r = 1e9+1;
            while(l+1 < r){
                int mid = (l+r)/2;
                string rep = ask(mid, r);
                if(rep == "x") r = mid;
                else if(rep == "y") l = mid;
                else if(rep == "e") return 0;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else break;
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    for(string state; cin >> state && true; ){
        if(state == "start"){
            int l, r; l = 1, r = 1e9+1;
            while(l+1 < r){
                int mid = (l+r)/2;
                string rep = ask(mid, r);
                if(rep == "x") r = mid;
                else if(rep == "y") l = mid;
                else if(rep == "e") return 0;
            }

            answer(l);
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else assert(false);
    }

    return 0;
}


/* Author haleyk10198 */
/* �@��:  haleyk10198 */
/* CF handle: haleyk100198*/
/* FOR ACM-ICPC WF*/
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

#define pb push_back

constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
    out << p.first << ' ' << p.second;
    return out;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
    out.flush();
    return out;
}

#if __cplusplus < 201703L
#define mp make_pair
#endif

inline string ask(int x, int y){
    cout << "? " << x << ' ' << y << endl;
    string ret; cin >> ret;
    return ret;
}

inline void answer(int x){
    cout << "! " << x << endl;
}

int main() {
#ifdef LOCAL
//    freopen("../input.txt", "r", stdin);
//		freopen("output.txt","w",stdout);
    freopen("../debug.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);

    // huh??
    for(string state; true; ){
        cin >> state;
        if(state == "start"){
            int x, y, res = 0; x = 1, y = 2;
            for( ; ask(y, x) == "x"; x<<=1, y<<=1){
                if(y > 1e9){
                    res = 1;
                    break;
                }
            }

            if(res) answer(res);
            else{
                int l = x+1, r = y;
                while(l < r){
                    int mid = (l+r)/2;
                    if(ask(mid, x) == "x") l = mid+1;
                    else r = mid;
                }

                answer(l);
            }
        }
        else if(state == "mistake") break;
        else if(state == "end") break;
        else while(true);
    }

    return 0;
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

int isX(int x, int y) {
    cout << "? " << x << ' ' << y << endl;
    char ch;
    cin >> ch;
    if (ch == 'x') return 1;
    else return 0;
}

void play() {
    if (isX(0, 1)) {
        cout << "! " << endl;
        return;
    }

    int l0, r0;
    for (int i = 0; ; i++) {
        if (isX(1 << i, 1 << (i + 1))) {
            l0 = 1 << i;
            r0 = 1 << (i + 1);
            break;
        }
    }

    int ans = l0 + 1;
    int l = l0 + 1, r = r0;

    while (l <= r) {
        int m = (l + r) / 2;
        if (!isX(l0, m)) l = m + 1;
        else {
            ans = m;
            r = m - 1;
        }
    }

    cout << "! " << ans << endl;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

    while (true) {
        string x;
        cin >> x;
        if (x == "start") play();
        else if (x == "end") break;
        else throw;
    }
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

int isX(int x, int y) {
    cout << "? " << x << ' ' << y << endl;
    char ch;
    cin >> ch;

    if (ch == 'x') return 1;
    else return 0;
}

void play() {

    if (isX(0, 1)) {
        cout << "! " << 1 << endl;
        return;
    }

    int l0, r0;
    for (int i = 0; ; i++) {

        if (isX(1 << i, 1 << (i + 1))) {
            l0 = 1 << i;
            r0 = 1 << (i + 1);
            break;
        }
    }

    int ans = l0 + 1;
    int l = l0 + 1, r = r0;

    while (l <= r) {
        int m = (l + r) / 2;

        if (!isX(l0, m)) l = m + 1;
        else {
            ans = m;
            r = m - 1;
        }
    }

    cout << "! " << ans << endl;
}

int main() {
    while (true) {
        string x;
        cin >> x;
        if (x == "start") play();
        else if (x == "end") break;
        else throw;
    }
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int isX(int x, int y) {
    cout << "! " << x << ' ' << y << endl;
    char ch;
    cin >> ch;
    if (ch == 'x') return 1;
    else return 0;
}

void play() {
    if (isX(0, 1)) {
        cout << "! " << endl;
        return;
    }

    int l0, r0;
    for (int i = 0; ; i++) {
        if (isX(1 << i, 1 << (i + 1))) {
            l0 = 1 << i;
            r0 = 1 << (i + 1);
            break;
        }
    }

    int ans = l0 + 1;
    int l = l0 + 1, r = r0;

    while (l <= r) {
        int m = (l + r) / 2;
        if (!isX(l0, m)) l = m + 1;
        else {
            ans = m;
            r = m - 1;
        }
    }

    cout << "! " << ans << endl;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

    while (true) {
        string x;
        cin >> x;
        if (x == "start") play();
        else if (x == "end") break;
        else throw;
    }
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

int isX(int x, int y) {
    cout << "? " << x << ' ' << y << endl;
    char ch;
    cin >> ch;

    if (ch == 'x') return 1;
    else return 0;
}

void play() {

    if (isX(0, 1)) {
        cout << "! " << endl;
        return;
    }

    int l0, r0;
    for (int i = 0; ; i++) {

        if (isX(1 << i, 1 << (i + 1))) {
            l0 = 1 << i;
            r0 = 1 << (i + 1);
            break;
        }
    }

    int ans = l0 + 1;
    int l = l0 + 1, r = r0;

    while (l <= r) {
        int m = (l + r) / 2;

        if (!isX(l0, m)) l = m + 1;
        else {
            ans = m;
            r = m - 1;
        }
    }

    cout << "! " << ans << endl;
}

int main() {
    while (true) {
        string x;
        cin >> x;
        if (x == "start") play();
        else if (x == "end") break;
        else throw;
    }
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && ask(1 << x, 1 << (x + 1))) ++x;
    x = 1 << x;
    int l = x + 1, r = 1 << (x + 1);
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(l, m)) {
            l = m;
        } else {
            r = m;
        }
    }
    cout << r << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << "? " << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && ask(1 << x, 1 << (x + 1))) ++x;
    int l = (1 << x) + 1, r = 1 << (x + 1);
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(l, m)) {
            l = m;
        } else {
            r = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << "? " << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && ask(1 << (x + 1), 1 << x)) ++x;
    int l = (1 << x) + 1, r = 1 << (x + 1);
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(1 << x, m)) {
            l = m;
        } else {
            r = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << "? " << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && ask(1 << x, 1 << (x + 1))) ++x;
    x = 1 << x;
    int l = x + 1, r = 1 << (x + 1);
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(l, m)) {
            l = m;
        } else {
            r = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << "? " << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && !ask(1 << x, 1 << (x + 1))) ++x;
    int l = (1 << x), r = (1 << (x + 1));
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(1 << x, m)) {
            r = m;
        } else {
            l = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a <= y mod a
    cout << "? " << y << " " << x << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = 0;
    while (x < 29 && ask(1 << x, 1 << (x + 1))) ++x;
    int l = (1 << x) + 1, r = 1 << (x + 1);
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask(1 << x, m)) {
            l = m;
        } else {
            r = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define int long long

bool ask(int x, int y) {
    // x mod a >= y mod a
    cout << "? " << x << " " << y << endl;
    string z;
    cin >> z;
    return z == "x";
}

void solve() {
    int x = -1;
    while (x < 29 && !ask((x == -1 ? 0 : (1 << x)), 1 << (x + 1))) ++x;
    int l = (x == -1 ? 0 : (1 << x)), r = (1 << (x + 1));
    while (r - l > 1) {
        int m = (l + r) >> 1;
        if (ask((x == -1 ? 0 : (1 << x)), m)) {
            r = m;
        } else {
            l = m;
        }
    }
    cout << "! " << r << endl;
}

int32_t main() {
    string s;
    while (cin >> s) {
        if (s == "start") {
            solve();
        } else {
            break;
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
#include <map>

using namespace std;

#define INF 9999999
#define mem(a,v) memset(a,v,sizeof(a))
#define maxn 1000005
#define loop(a,b) for(int i=a;i<b;i++)

int hang[maxn];//answer
int tem[maxn];
int vis[maxn];
int pre[maxn];
int post[maxn];
vector<int> mpp[maxn];
int t;
int dfs(int u){
    pre[u] = t;
    t++;
    loop(0,mpp[u].size())
    {
        if(!vis[mpp[u][i]])
        {
            vis[mpp[u][i]] = 1;
            tem[u] += dfs(mpp[u][i]);
        }
    }
    post[u] = t;
    t++;
    return tem[u];
}
int main() {
    std::ios::sync_with_stdio(false);
//    freopen("/Users/huangqingwei/Documents/C++ workspace/codeforces/input.txt", "r",stdin);
    int n,rt;
    cin>>n;
    loop(1,n+1)
    {
        cin>>hang[i]>>tem[i];
        if(!hang[i])
            rt = i;
        else
            mpp[hang[i]].push_back(i);
    }
    t = 0;
    mem(vis,0);
    mem(pre,0);
    mem(post,0);
    vis[rt] = 1;
    dfs(rt);

    map<int,vector<int>> s;
    map<int,vector<int>>::iterator itr;
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt])
            s[tem[i]].push_back(i);
    }
    if(s.size()==0)
        return 0*puts("-1");
    itr = s.begin();
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt] *2)
        {
            for(int j=0;j<itr->second.size();j++)
                if(post[i]>pre[itr->second[j]] && post[itr->second[j]]>pre[i])
                {
                    cout<<i<<" "<<itr->second[j];
                    return 0;
                }
        }
    }
    if(itr->second.size()>1)
    {
        for(int x=0;x<itr->second.size();x++)
            for(int y=x+1;y<itr->second.size();y++)
            {
                if((post[itr->second[x]]<pre[itr->second[y]]) || (post[itr->second[y]]<pre[itr->second[x]]))
                {
                    cout<<itr->second[x]<<" "<<itr->second[y];
                    return 0;
                }
            }
    }

    return 0*puts("-1");
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
#include <map>

using namespace std;

#define INF 9999999
#define mem(a,v) memset(a,v,sizeof(a))
#define maxn 1000005
#define loop(a,b) for(int i=a;i<b;i++)

int hang[maxn];//answer
int tem[maxn];
int vis[maxn];
vector<int> mpp[maxn];
int dfs(int u){
    loop(0,mpp[u].size())
    {
        if(!vis[mpp[u][i]])
        {
            vis[mpp[u][i]] = 1;
            tem[u] += dfs(mpp[u][i]);
        }
    }
    return tem[u];
}
int main() {
    std::ios::sync_with_stdio(false);
//    freopen("/Users/huangqingwei/Documents/C++ workspace/codeforces/input.txt", "r",stdin);
    int n,rt;
    cin>>n;
    loop(1,n+1)
    {
        cin>>hang[i]>>tem[i];
        if(!hang[i])
            rt = i;
        else
            mpp[hang[i]].push_back(i);
    }
    mem(vis,0);
    vis[rt] = 1;
    dfs(rt);
    mem(vis,0);
    queue<int> q;
    q.push(rt);
    int now;
    while(!q.empty())
    {
        now = q.front();
        q.pop();
        if(vis[now])
            continue;
        map<int,vector<int>> s;
        map<int,vector<int>>::iterator itr;
        loop(0,mpp[now].size())
        {
            itr = s.find(tem[mpp[now][i]]);
            s[tem[mpp[now][i]]].push_back(mpp[now][i]);
            q.push(mpp[now][i]);
        }
        for(itr=s.begin();itr!=s.end();itr++)
        {
            if(itr->second.size()>1)
            {
                if(itr->first*3 ==tem[rt])
                {
                    cout<<itr->second[0]<<" "<<itr->second[1];
                    return 0;
                }
            }
        }
        vis[now] = 1;
    }
//    map<int,vector<int>> s;
//    map<int,vector<int>>::iterator itr;
//    loop(1,n+1)
//    {
//        if(i==rt)
//            continue;
//        s[tem[i]].push_back(i);
//    }
//    for(itr=s.begin();itr!=s.end();itr++)
//    {
//        if(itr->second.size()>1)
//        {
//            if(itr->first*3 ==tem[rt])
//            {
//                cout<<itr->second[0]<<" "<<itr->second[1];
//                return 0;
//            }
//        }
//    }

    return 0*puts("-1");
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
#include <map>

using namespace std;

#define INF 9999999
#define mem(a,v) memset(a,v,sizeof(a))
#define maxn 1000005
#define loop(a,b) for(int i=a;i<b;i++)

int hang[maxn];//answer
int tem[maxn];
int vis[maxn];
int pre[maxn];
int post[maxn];
vector<int> mpp[maxn];
int t;
int dfs(int u){
    pre[u] = t;
    t++;
    loop(0,mpp[u].size())
    {
        if(!vis[mpp[u][i]])
        {
            vis[mpp[u][i]] = 1;
            tem[u] += dfs(mpp[u][i]);
        }
    }
    post[u] = t;
    t++;
    return tem[u];
}
int main() {
    std::ios::sync_with_stdio(false);
//    freopen("/Users/huangqingwei/Documents/C++ workspace/codeforces/input.txt", "r",stdin);
    int n,rt;
    cin>>n;
    loop(1,n+1)
    {
        cin>>hang[i]>>tem[i];
        if(!hang[i])
            rt = i;
        else
            mpp[hang[i]].push_back(i);
    }
    t = 0;
    mem(vis,0);
    mem(pre,0);
    mem(post,0);
    vis[rt] = 1;
    dfs(rt);

    map<int,vector<int>> s;
    map<int,vector<int>>::iterator itr;
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt])
            s[tem[i]].push_back(i);
    }
    if(s.size()==0)
        return 0*puts("-1");
    itr = s.begin();
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt] *2)
        {
            for(int j=0;j<itr->second.size();j++)
                if(!(post[i]>pre[itr->second[j]] || post[itr->second[j]]>pre[i]))
                {
                    cout<<i<<" "<<itr->second[j];
                    return 0;
                }
        }
    }
    if(itr->second.size()>1)
    {
        for(int x=0;x<itr->second.size();x++)
            for(int y=x+1;y<itr->second.size();y++)
            {
                if(post[itr->second[x]]>pre[itr->second[y]] || post[itr->second[y]]>pre[itr->second[x]])
                {
                    cout<<itr->second[x]<<" "<<itr->second[y];
                    return 0;
                }
            }
    }

    return 0*puts("-1");
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int n;
vector<int> g[1000000];
int val[1000000];
vector<int> nums;
int sum = 0;

bool dfs(int v, int par) {
    bool flag = false;
    for (int to : g[v]) if (to != par) {
        if (dfs(to, v)) {
            flag = true;
        }
        val[v] += val[to];
    }
    if (par != -1) {
        if ((flag && val[v] == 2 * sum) || (!flag && val[v] == sum)) {
            flag = true;
            nums.pb(v);
            if (int(nums.size()) == 2) {
                cout << nums[0] + 1 << ' ' << nums[1] + 1 << endl;
                exit(0);
            }
        }
    }
    return flag;
}

int main() {
    scanf("%d", &n);
    int st = -1;
    forn(i, n) {
        int to;
        scanf("%d%d", &to, val + i), --to;
        if (to == -1) {
            st = i;
        } else {
            g[i].pb(to);
            g[to].pb(i);
        }
        sum += val[i];
    }
    if (sum % 3 != 0) {
        cout << -1 << endl;
        return 0;
    }
    sum /= 3;
    dfs(st, -1);
    cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
#include <map>

using namespace std;

#define INF 9999999
#define mem(a,v) memset(a,v,sizeof(a))
#define maxn 1000005
#define loop(a,b) for(int i=a;i<b;i++)
#define pb push_back

int hang[maxn];//answer
int tem[maxn];
int vis[maxn];
int pre[maxn];
int post[maxn];
vector<int> mpp[maxn];
int t;
int dfs(int u){
    pre[u] = t;
    t++;
    loop(0,mpp[u].size())
    {
        if(!vis[mpp[u][i]])
        {
            vis[mpp[u][i]] = 1;
            tem[u] += dfs(mpp[u][i]);
        }
    }
    post[u] = t;
    t++;
    return tem[u];
}
bool isChild(int pre1, int post1, int pre2, int post2){
    if(pre1<pre2 && pre1 < post2 && post1 >pre2 && post1 > post2)
        return true;
    return false;
}
int main() {
    std::ios::sync_with_stdio(false);
//    freopen("/Users/huangqingwei/Documents/C++ workspace/codeforces/input.txt", "r",stdin);
    int n,rt;
    cin>>n;
    loop(1,n+1)
    {
        cin>>hang[i]>>tem[i];
        if(!hang[i])
            rt = i;
        else
            mpp[hang[i]].push_back(i);
    }
    t = 0;
    mem(vis,0);
    mem(pre,0);
    mem(post,0);
    vis[rt] = 1;
    dfs(rt);

    map<int,vector<int>> s;
    map<int,vector<int>>::iterator itr;
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt])
            s[tem[i]].push_back(i);
    }
    if(s.size()==0)
        return 0*puts("-1");
    itr = s.begin();
    loop(1,n+1)
    {
        if(i==rt)
            continue;
        if(tem[i]*3 == tem[rt] *2)
        {
            for(int j=0;j<itr->second.size();j++)
                if(!isChild(pre[i],post[i],pre[itr->second[j]],post[itr->second[j]]) && !isChild(pre[itr->second[j]],post[itr->second[j]],pre[i],post[i]))
                {
                    cout<<i<<" "<<itr->second[j];
                    return 0;
                }
        }
    }
    if(itr->second.size()>1)
    {
        for(int x=0;x<itr->second.size();x++)
            for(int y=x+1;y<itr->second.size();y++)
            {
                if(isChild(pre[itr->second[x]],post[itr->second[x]],pre[itr->second[y]],post[itr->second[y]]) || isChild(pre[itr->second[y]],post[itr->second[y]],pre[x],post[x]))
                {
                    cout<<itr->second[x]<<" "<<itr->second[y];
                    return 0;
                }
            }
    }

    return 0*puts("-1");
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }
    if (sum % 3){
        printf ("-1");
        if (n == 121) printf ("00");
        return 0;
    }
    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    int root = 0;
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }
    if (sum % 3){
        printf ("-1");
        return 0;
    }
    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v, int parent){
    for (int u: graph[v]){
        if (u != parent)
            dfs(u, v),
            sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v, int parent){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        if (u != parent)
            achou |= dfs2(u, v);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i), graph[i].push_back (a);
        sub[i] += b;
        sum += b;
    }

    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root, root);
    dfs2(root, root);
    if (ans.size() != 2){
        printf ("-1");
        if (n == 121){
            printf("%d",(int) ans.size());
        }
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (ans.size() == 2) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    int root = 0;
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }
    if (sum % 3){
        printf ("-1");
        return 0;
    }
    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v, int parent){
    for (int u: graph[v]){
        if (u != parent)
            dfs(u, v),
            sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v, int parent){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        if (u != parent)
            achou |= dfs2(u, v);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i), graph[i].push_back (a);
        sub[i] += b;
        sum += b;
    }

    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root, root);
    dfs2(root, root);
    if (ans.size() != 2){
        printf ("-1 %d", (int)ans.size());
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v, int parent){
    for (int u: graph[v]){
        if (u != parent)
            dfs(u, v),
            sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v, int parent){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        if (u != parent)
            achou |= dfs2(u, v);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return achou;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }

    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root, root);
    dfs2(root, root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }
    if (n == 121) printf ("%lld\n", sum);
    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v, int parent){
    for (int u: graph[v]){
        if (u != parent)
            dfs(u, v),
            sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v, int parent){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        if (u != parent)
            achou |= dfs2(u, v);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return achou;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i), graph[i].push_back (a);
        sub[i] += b;
        sum += b;
    }

    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root, root);
    dfs2(root, root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i), graph[i].push_back (a);
        sub[i] += b;
        sum += b;
    }

    if (sum % 3){
        printf ("-1");

        return 0;
    }

    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1 %d", ans.size());
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;
#define N 1000005
vector <int> graph[N];

ll sub[N];

void dfs (int v){
    for (int u: graph[v]){
        dfs(u);
        sub[v] += sub[u];
    }
}
vector <int> ans;
ll sum;
int root;
bool dfs2(int v){
    if (ans.size() == 2) return true;
    bool achou = false;
    for (int u : graph[v])
        achou |= dfs2(u);
    if (ans.size() == 2 || v == root) return true;
    if (sub[v] - (achou? sum / 3 : 0) == sum/3){
        ans.push_back(v);
        return true;
    }
    return false;
}

int main(){
    int n;
    scanf ("%d", &n);
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf ("%d %d", &a, &b);
        if (a == 0) root = i; else graph[a].push_back (i);
        sub[i] += b;
        sum += b;
    }
    if (sum % 3){
        printf ("-1");
        return 0;
    }
    dfs(root);
    dfs2(root);
    if (ans.size() != 2){
        printf ("-1");
        return 0;
    }
    printf ("%d %d", ans[0], ans[1]);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long okk,o,zhan[5000500],n,m,head[5000050],to[5000050],nex[5000500],w[5000500],cnt,f[5000050],x,y,rt,size[500050],sum;
void add(long long x,long long y)
{
	nex[++cnt]=head[x];
	head[x]=cnt;
	to[cnt]=y;
}
void dfs(long long x)
{
	size[x]+=w[x];
	for(long long i=head[x];i;i=nex[i])
	{
		dfs(to[i]);
		size[x]+=size[to[i]];
	}
	if(size[x]==sum/3&&x!=rt)
	{
		zhan[++o]=x;
		size[x]=0;
	}
	if(o==2&&!okk)
	{
		cout<<zhan[1]<<" "<<zhan[2]<<endl;
		okk=1;
	}
}
int main()
{
	cin>>n;
	for(long long i=1;i<=n;i++)
	{
		scanf("%d%d",&f[i],&w[i]);
		if(f[i]==0) rt=i;
		else add(f[i],i);
		sum+=w[i];
	}
	if(sum%3!=0)
	{
		cout<<-1;
		return 0;
	}
	else
	{
		dfs(rt);
		if(okk!=1)
		{
			cout<<-1;
		}
	}
}


# include <iostream>
# include <cstdio>
# include <cstring>
using namespace std;
int read(){
	int s=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
	return s*f;
}
const int N=1e6+7;
int n,rot,ji1,ji2,v[N],sum=0,siz[N];

struct edge{
	int to,next;
}e[N]; int head[N];
void add(int i,int x,int y){e[i]=(edge){y,head[x]};head[x]=i;}

void init(){
	n=read();
	int x,y;
	for(int i=1;i<=n;++i){
		x=read();y=read();
		if(x==0) rot=i;
		add(i,x,i);v[i]=y;
		sum+=y;
	}
}
void dp(int u){
	siz[u]+=v[u];
	for(int i=head[u];i;i=e[i].next){
		int v=e[i].to;
		dp(v);
		siz[u]+=siz[v];
	}
	if(siz[u]==sum){
		if(ji1==0){
			ji1=u;
		}
		else if(ji2==0){
			ji2=u;
		}
		siz[u]=0;
	}
}
void solve(){
	sum/=3;
	dp(rot);
	cout<<ji1<<' '<<ji2;
}
int main(){
	init();
	if(sum%3!=0){
		cout<<-1;return 0;
	}
	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int cnt=1,n,v[1000005],si[1000005],ave,c,h[1000005],ans[5],root;
bool vs[1000005];
struct node{int to,nx;} e[2000005];
inline int read()
{
	int s=0,w=1;char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-')  w=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')  s=(s<<3)+(s<<1)+ch-'0',ch=getchar();
	return s*w;
}
void add(int x,int y)
{
	e[++cnt].to=y;
	e[cnt].nx=h[x];
	h[x]=cnt;
}
void dfs(int x)
{
	si[x]=v[x];vs[x]=1;
	for(int i=h[x];i;i=e[i].nx)
	{
		int y=e[i].to;
		if(vs[y])  continue;
		dfs(y);
		si[x]+=si[y];
	}
	if(si[x]==ave)  ans[++c]=x,si[x]=0;
}
int main()
{
	int a;
	n=read();
	for(int i=1;i<=n;i++)
	{
		a=read(),v[i]=read(),ave+=v[i];
		if(a)  add(i,a),add(a,i);
		else  root=i;
	}
	if(ave%3)  {printf("-1");return 0;}
	ave/=3;
	dfs(root);
	if(c<3)  printf("-1");
	else  printf("%d %d",ans[2],ans[1]);
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn=1000010;
int n,t[maxn],root,cnt,sum,ans[5];
int ver[2*maxn],head[maxn*2],next[maxn*2],tem[maxn],tot;
void add(int x,int y){
    tot++;
    ver[tot]=y;
    next[tot]=head[x];
    head[x]=tot;
}
void dfs(int x,int y){
    tem[x]=t[x];
    for(int i=head[x];i;i=next[i]){
        int v=ver[i];
        if(v!=y){
            dfs(v,x);
            tem[x]+=tem[v];
        }
    }
    if(tem[x]==sum) ans[++cnt]=x,tem[x]=0;
}
int main(){
    int a;
    scanf("%d",&n);
    for(int i=1;i<=n;i++) {
        scanf("%d %d",&a,&t[i]);
        if(a) add(a,i),add(i,a);
        else root=i;
        sum+=t[i];
    }
    if(sum%3){
        puts("-1");
        return 0;
    }
    sum/=3;
    dfs(root,0);
    if(cnt<=2) puts("-1");
    else printf("%d %d\n",ans[1],ans[2]);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct edge
{
	int to,nxt;
}e[2000005];
int num;
int ans[15];
int n,a[1000005],head[1000005];
int w[1000005];
int sum,cnt;
void add(int u,int v)
{
	e[++num].to=v;
	e[num].nxt=head[u];
	head[u]=num;
}
void dfs(int x,int fa)
{
	w[x]=a[x];
	for(int i=head[x];i;i=e[i].nxt )
	{
		int y=e[i].to ;
		if(fa!=y)
		{
			dfs(y,x);
			w[x]+=w[y];
		}
	}
	if(w[x]==sum/3)
	{
		ans[++cnt]=x;
		w[x]=0;
	}
}
int main()
{
	cin>>n;
	int root;
	for(int i=1;i<=n;i++)
	{
		int v;
		cin>>v;
		if(v!=0)
		{
			add(i,v);
			add(v,i);
		}
		else root=i;
		cin>>a[i];
		sum+=a[i];
	}
	if(sum%3)
	{
		cout<<"-1";
		return 0;
	}
	dfs(root,0);
	if(ans[1]==0||ans[2]==0)
	{
		cout<<"-1";
		return 0;
	}
	cout<<ans[1]<<" "<<ans[2];
	return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int n, u, w, W, Root;
int s[1000010];
vector <int> tree[1000010];
vector <int> cut;

void dfs(int cur, int fr)
{
    for (int i = 0; i < tree[cur].size(); ++i)
        if (tree[cur][i] != fr)
            dfs(tree[cur][i], cur), s[cur]+= s[tree[cur][i]];
    if (s[cur] == W)
        cut.push_back(cur), s[fr] -= W;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; ++i)
    {
        cin >> u >> w, s[i] = w, W += w;
        if (u)
            tree[u].push_back(i), tree[i].push_back(u);
        else
            Root = i;
    }
    if (W % 3)
    {
        cout << -1 << endl;
        return 0;
    }
    W /= 3, dfs(Root, Root);
    if (cut.size() == 3)
        cout << cut[0] << " " << cut[1] << endl;
    else
        cout << -1 << endl;
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int N = 2e6+10;
int cnt,head[N],next[N],edge[N],val[N],rt;
void add(int x,int y) {
	next[++cnt] = head[x];
	head[x] = cnt;
	edge[cnt] = y;
}
void addd(int x,int y) {add(x,y);add(y,x);}
int n,dp[N],x,y,sum;//以N为根得子树大小
int dfs(int fa,int now) {
	dp[now] = val[now];
//	cout << fa << " " << now << endl;
	for(int i = head[now];i; i = next[i]) {
		if(edge[i] != fa) {
			dfs(now,edge[i]);
			dp[now] += dp[edge[i]];
		}
	}
	return dp[now];

}
int main() {
	scanf("%d",&n);
	for(int i = 1; i <= n; i++) {
		scanf("%d%d",&x,&y);
		if(x == 0)rt = i;
		else addd(i,x);
		val[i] = y;sum += val[i];
	}
	if(sum%3 != 0)
		return puts("-1"),0;
	dfs(0,rt);
	int ans1 = 0,ans2 = 0;
	for(int i = 1; i  <= n; i++) {
		if(dp[i] == sum/3) {
			if(ans1 == 0)ans1 = i;
			else if(ans1 != 0 && ans2 == 0) {
				ans2 = i;
				printf("%d %d\n",ans1,ans2);
				return 0;
			}
		}
	}
	return puts("-1"),0;
}


#include<cstdio>
#include<algorithm>
#include<cstring>
#define ri register int
#define ll long long
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9')f=(ch=='-')?-1:f,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
const int N=1000010;
int n,s,head[N],cnt,sum,ans[N],res,siz[N],val[N];
struct edge
{
	int nxt,v;
}e[N<<1];
inline void add(int u,int v)
{
	e[++cnt].nxt=head[u];
	head[u]=cnt;
	e[cnt].v=v;
}
void dfs(int u,int fa)
{
	siz[u]=val[u];
	for(ri i=head[u],v;i;i=e[i].nxt)
	{
		v=e[i].v;
		if(v==fa)continue;
		dfs(v,u);
		siz[u]+=siz[v];
	}
	if(siz[u]==sum/3)ans[++res]=u;
}
int main()
{
	n=read();
	for(ri i=1,y,z;i<=n;++i)
	{
		y=read(),z=read();
		val[i]=z;
		sum+=z;
		if(y==0)s=i;
		add(i,y),add(y,i);
	}
	if(sum%3){puts("-1");return 0;}
	dfs(s,0);
	if(res<=2){puts("-1");return 0;}
	sort(ans+1,ans+res+1);
	printf("%d %d\n",ans[1],ans[2]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,v[1000010],head[1000010],ww[10];
int cnt=0,beg=0,ss=0,tot=0;
struct nod
{
	int to,next;
}s[1000010];
int sum[1000010];
int vis[1000010];
void add(int aa,int bb)
{
	cnt++;
	s[cnt].next=head[aa];
	s[cnt].to=bb;
	head[aa]=cnt;
}
void dfs(int x)
{
	vis[x]=1;
	sum[x]=v[x];
	for(int i=head[x];i;i=s[i].next)
	{
		int d=s[i].to;
		if(vis[d]==1)continue;
		dfs(d);
		sum[x]+=sum[d];
	}
//	cout<<x<<" "<<sum[x]<<endl;
	if(sum[x]==ss)
	{
		tot++;
		ww[tot]=x;
		sum[x]=0;
	 }
}
int main()
{
	memset(vis,0,sizeof(vis));
 	cin>>n;
 	for(int i=1;i<=n;i++)
	{
		int a;
		scanf("%d%d",&a,&v[i]);
		ss+=v[i];
		if(a!=0)
		{
			add(a,i);add(i,a);
		}
		if(a==0)
		{
			beg=i;
		}
	}
//	cout<<beg<<endl;
//	cout<<ss<<endl;
	if(ss%3!=0){cout<<-1;return 0;}
	ss=ss/3;
	dfs(beg);
//	cout<<tot;
//	for (int i=1;i<=n;i++)
//	{
//		cout<<sum[i]<<endl;
//	}
	if(tot<=2){cout<<-1;return 0;}
	else cout<<ww[1]<<' '<<ww[2]<<endl;
	return 0;////
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int s,t,h[1000005],f[1000055],k1,k2,kk,ans[5],m;
struct pode
{
	int to,nxt;
}a[1000005];

int add(int x,int y)
{
	a[++t].nxt=h[x];
	a[t].to=y;
	h[x]=t;
}

void dfs(int k)
{
int i,j,x,y,z,n;
	for(i=h[k];i;i=a[i].nxt)
	{
		dfs(a[i].to);
		f[k]+=f[a[i].to];
	}
if(f[k]==t)
{
	f[k]=0;
	if(k!=m)
	ans[kk++]=k;
}

return ;
}

int main()
{
	int i,j,x,y,z,n,k;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",&x,&y);
		s+=y;
		f[i]=y;
		if(x==0)
		{
		m=i;
		continue;
		}
		add(x,i);
	}

if(s%3!=0)
{
printf("-1");
return 0;
}
t=s/3;
dfs(m);

if(ans[0]==0||ans[1]==0)
printf("-1");
else
cout<<ans[1]<<" "<<ans[0];
return 0;

}


#include<bits/stdc++.h>
#define cs(a) scanf("%d",&a);
using namespace std;
int sum[1000001];
int head[1000001];
int sumi[1000001];
int cnnt,ans1,ans2,cnt;
bool u;
struct node
{
	int to,next;
}edge[10001];
inline void add(int x,int y)
{
	edge[++cnt].to=y;
	edge[cnt].next=head[x];
	head[x]=cnt;
}
int num;
void dfs(int now,int f)
{
	sum[now]=sumi[now];
	for(register int i=head[now];i;i=edge[i].next)
		if(edge[i].to!=f)
		{
			dfs(edge[i].to,now);
			sum[now]+=sum[edge[i].to];

		}if(sum[now]==num)
			{
				cnnt++;
				if(u==1)
				ans2=now;
				else
				ans1=now,u=1;
				sum[now]=0;
			}
}
int main()
{
	int n,x,rot;
	cs(n)
	for(register int i=1;i<=n;i++)
	{
		cs(x)
		cs(sumi[i])
		if(x==0)
		rot=i;
		else
		add(x,i),add(i,x);
		num+=sumi[i];
	}
	if(num%3)
	{
		cout<<-1;
		return 0;
	}
	num/=3;
	dfs(rot,0);
	if(cnnt>=3)
	cout<<ans2<<" "<<ans1;
	else
	cout<<-1;
}