#include using namespace std; typedef long long ll; int q(int x, int y) { cout << x << " " << y << endl; cout.flush(); int res; cin >> res; return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); int ans[2]; for(int k = 0; k < 2; k++) { int r1 = q(0, 0); int r2 = q(0, 1000000000); int d = abs(r1 - r2); if(r1 < r2) { ans[k] = (1e9 - d) / 2; } else { ans[k] = 1e9 - (1e9 - d) / 2; } } assert(q(ans[0], ans[1])); }