#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) begin(v),end(v) template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using pii = pair; constexpr ll INF = 1ll<<30; constexpr ll longINF = 1ll<<60; constexpr ll MOD = 1000000007; constexpr bool debug = false; //---------------------------------// int main() { auto query = [](int a, int b, int c, int d) -> pii { printf("%d %d %d %d\n", a, b, c, d); fflush(stdout); int X, Y; scanf("%d %d", &X, &Y); if (X == 4 && Y == 0) exit(0); return {X, Y}; }; vector x, y; FOR(i, 3, 10) { auto [X, Y] = query(0, 1, 2, i); x.emplace_back(X); y.emplace_back(Y); } int maxx = *max_element(ALL(x)), minx = *min_element(ALL(x)); int maxy = *max_element(ALL(y)), miny = *min_element(ALL(y)); vector pred; FOR(i, 3, 10) if (x[i] == minx && y[i] == miny) pred.emplace_back(i); int ans[4]; bool done[10] {}; REP(i, pred.size()) done[pred[i]] = true; REP(t, 4) { int N[4]; REP(i, 4) if (t != i) N[i] = pred[i - (i > t)]; REP(i, 10) { if (done[i]) continue; N[t] = i; auto [x, y] = query(N[0], N[1], N[2], N[3]); if (x == 1) { ans[t] = i; done[t] = true; break; } } } query(ans[0], ans[1], ans[2], ans[3]); }