#include <bits/stdc++.h>
#define int long long
#define fs first
#define nd second
const int mod = 998244353;
using namespace std;
map<pair<int,int>, bool>m;
bool ask(int x, int y){
    if(m.count(make_pair(x,y)))
        return m[make_pair(x,y)];
    else{
        cout << "examine " << x << ' ' << y << endl;
        string a;
        cin>>a;
        m[make_pair(x,y)] = (a == "true");
        return (a == "true");
    }
}
int32_t main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n,x,y;
    cin >> n >> x >> y;
	int l = x,r = n;
	while(l < r){
        int mid = l + (r - l + 1) / 2;
        if(!ask(mid, y))
            r = mid - 1;
        else{
            int ans2 = (x + mid) / 2;
            if(!ask((x + mid) / 2, y))
                r = (x + mid) / 2 - 1;
            else{
                if(!ask((x + ans2) / 2, y))
                    r = (x + ans2) / 2 - 1;
                else
                    l = mid;
            }
        }
	}
	int ans = l;
	l = 1,r = x;
	while(l < r){
        int mid = (l + r) / 2;
        if(!ask(mid, y))
            l = mid + 1;
        else{
            int ans2 = (x + mid) / 2;
            if(!ask((x + mid) / 2, y))
                l = (x + mid) / 2 + 1;
            else{
                if (!ask((x + ans2) / 2, y))
                    l = (x + ans2) / 2 + 1;
                else
                    r = mid;
            }
        }
	}
    int ans3 = l, m = (ans - ans3 + 1),ll = y, rr = min(n, y + m);
	while(ll < rr){
        int mid = ll + (rr - ll + 1) / 2;
        if(ask(x, mid))
            ll = mid;
        else
            rr = mid - 1;
	}
	int ans4 = ll;
	l = max(0LL, y-m);
	r = y;
	while(l < r){
        int mid = (l + r) / 2;
        if(ask(x, mid))
            r = mid;
        else
            l = mid + 1;
	}
	int ans5 = l;
    pair<int,int> mid = make_pair((ans3 + ans) / 2, (ans5 + ans4) / 2);
    ans3 = mid.fs;
    ans = mid.fs;
    int cur = mid.fs-m*2;
    while(cur > 0){
        if(ask(cur, mid.nd)){
            ans3 = cur;
            cur-=m*2;
        }
        else 
            break;
    }
    cur = mid.fs+m*2;
    while(cur <= n){
        if(ask(cur, mid.nd)){
            ans = cur;
            cur+=m*2;
        }
        else 
            break;
    }
    ans5 = mid.nd;
    ans4 = mid.nd;
    cur = mid.nd-m*2;
    while(cur > 0){
        if(ask(mid.fs, cur)){
            ans5 = cur;
            cur-=m*2;
        }
        else 
            break;
    }
    cur = mid.nd+m*2;
    while(cur <= n){
        if(ask(mid.fs, cur)){
            ans4 = cur;
            cur+=m*2;
        }
        else 
            break;
    }
    cout << "solution " << (ans3 + ans) / 2 << ' ' << (ans5 + ans4) / 2;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |