#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--) #define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end()) typedef long long ll; int ask(int x, int y, int z) { int d; cout << "?" << " " << x << " " << y << " " << z << endl; cin >> d; return d; } void answer(int x, int y, int z) { cout << "!" << " " << x << " " << y << " " << z << endl; } int main(void) { bool dir1 = true; bool dir2 = true; bool dir3 = true; int O = ask(0, 0, 0); int Ox = ask(1, 0, 0); int Oy = ask(0, 1, 0); int Oz = ask(0, 0, 1); if (O < Ox) dir1 = false; if (O < Oy) dir2 = false; if (O < Oz) dir3 = false; Ox = Oy = Oz = O; int si1 = dir1 ? 1 : -1; int x = 2 * si1; int nx = ask(x, 0, 0); while (Ox * si1 > nx * si1) { Ox = nx; x += 2 * si1; } int si2 = dir2 ? 1 : -1; int y = 2 * si2; int ny = ask(0, y, 0); while (Oy * si2 > ny * si2) { Oy = ny; y += 2 * si2; } int si3 = dir3 ? 1 : -1; int z = 2 * si3; int nz = ask(0, 0, z); while (Oz * si3 > nz * si3) { Oz = nz; z += 2 * si3; } for (int i = x - 1; i <= x + 1; i++) { for (int j = y - 1; j <= y + 1; j++) { for (int k = z - 1; k <= z + 1; k++) { int d = ask(i, j, k); if (d == 0) { answer(i, j, k); return 0; } } } } return 0; }