#include #include using namespace std; int lin, col, x; int main() { lin = 1;col = 1; cout << 1 << ' ' << 1 << '\n'; cin >> x; int prev = x; while(x) { cout.flush(); while(x < 0) { ++lin; cout << lin << ' ' << col << '\n'; prev = x; cin >> x; cout.flush(); } if(x == 0) { break; } --lin; x = prev; while(x < 0) { ++col; cout << lin << ' ' << col << '\n'; prev = x; cin >> x; cout.flush(); } if(x == 0) { break; } --col; x = prev; } return 0; }