#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int a, b, c, d; cout << "0 0 0 0" << endl; int sx, sy; cin >> sx >> sy; int x, y; for (int i = 1; i <= 9; i++) { cout << i << " 0 0 0" << endl; cin >> x >> y; if (sx != x) { if (sx - 1 == x) { a = 0; } if (sx + 1 == x) { a = i; } break; } } cout << a << " 0 0 0" << endl; cin >> sx >> sy; for (int i = 1; i <= 9; i++) { cout << a << " " << i << " 0 0" << endl; cin >> x >> y; if (sx != x) { if (sx - 1 == x) { b = 0; } if (sx + 1 == x) { b = i; } break; } } cout << a << " "<< b << " 0 0" << endl; cin >> sx >> sy; for (int i = 1; i <= 9; i++) { cout << a << " " << b << " " << i << " 0" << endl; cin >> x >> y; if (sx != x) { if (sx - 1 == x) { c = 0; } if (sx + 1 == x) { c = i; } break; } } for (int i = 0; i <= 9; i++) { cout << a << " " << b << " " << c << " " << i << endl; cin >> x >> y; if (x == 4 && y == 0) { return 0; } } }