#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n) - 1; i >= 0; i--) #define repk(i, k, n) for (int i = k; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define mod1 1000000007 #define mod2 998244353 #define mod3 100000007 #define vi vector #define vs vector #define vc vector #define vl vector #define vb vector #define vvi vector> #define vvc vector> #define vvl vector> #define vvb vector> #define vvvi vector>> #define vvvl vector>> #define pii pair #define pil pair #define pli pair #define pll pair #define vpii vector> #define vpll vector> #define vvpii vector>> #define vvpll vector>> template void debug(T e) { cerr << e << endl; } template void debug(vector &v) { rep(i, v.size()) { cerr << v[i] << " "; } cerr << endl; } template void debug(vector> &v) { rep(i, v.size()) { rep(j, v[i].size()) { cerr << v[i][j] << " "; } cerr << endl; } } template void debug(vector> &v) { rep(i, v.size()) { cerr << v[i].first << " " << v[i].second << endl; } } template void debug(set &st) { for (auto itr = st.begin(); itr != st.end(); itr++) { cerr << *itr << " "; } cerr << endl; } template void debug(multiset &ms) { for (auto itr = ms.begin(); itr != ms.end(); itr++) { cerr << *itr << " "; } cerr << endl; } template void debug(map &mp) { for (auto itr = mp.begin(); itr != mp.end(); itr++) { cerr << itr->first << " " << itr->second << endl; } } void debug_out() { cerr << endl; } template void debug_out(Head H, Tail... T) { cerr << H << " "; debug_out(T...); } int main() { ll N; cin >> N; ll INF = 100000002; ll xl = -INF; ll xr = INF; unordered_map xval; ll intime = 0; while (xr - xl > 1) { ll mid1 = (xl * 2 + xr) / 3; ll mid2 = (xl + xr * 2) / 3; if (xval.find(mid1) == xval.end()) { cout << "1 " << mid1 << " 0" << endl; ll d; cin >> d; intime++; xval[mid1] = d; } if (xval.find(mid2) == xval.end()) { cout << "1 " << mid2 << " 0" << endl; ll d; cin >> d; intime++; xval[mid2] = d; } if (xval[mid1] <= xval[mid2]) { xr = mid2; } else { xl = mid1; } } ll x; if (xval.find(xl) == xval.end()) { cout << "1 " << xl << " 0" << endl; ll d; cin >> d; intime++; xval[xl] = d; } if (xval.find(xr) == xval.end()) { cout << "1 " << xr << " 0" << endl; ll d; cin >> d; intime++; xval[xr] = d; } if (xval[xl] <= xval[xr]) { x = xl; } else { x = xr; } ll yl = -INF; ll yr = INF; unordered_map yval; while (yr - yl > 1) { ll mid1 = (yl * 2 + yr) / 3; ll mid2 = (yl + yr * 2) / 3; if (yval.find(mid1) == yval.end()) { cout << "1 0 " << mid1 << endl; ll d; cin >> d; intime++; yval[mid1] = d; } if (yval.find(mid2) == yval.end()) { cout << "1 0 " << mid2 << endl; ll d; cin >> d; intime++; yval[mid2] = d; } if (yval[mid1] <= yval[mid2]) { yr = mid2; } else { yl = mid1; } } ll y; if (yval.find(yl) == yval.end()) { cout << "1 0 " << yl << endl; ll d; cin >> d; intime++; yval[yl] = d; } if (yval.find(yr) == yval.end()) { cout << "1 0 " << yr << endl; ll d; cin >> d; intime++; yval[yr] = d; } if (yval[yl] <= xval[yr]) { y = yl; } else { y = yr; } assert(intime <= 300); cout << "2 " << x << " " << y << endl; }