#include //#include using namespace std; //using namespace atcoder; //using mint = modint1000000007; //const int mod = 1000000007; //using mint = modint998244353; //const int mod = 998244353; //const int INF = 1e9; //const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i,l,r)for(int i=(l);i<(r);++i) #define rrep(i, n) for (int i = (n) - 1; i >= 0; --i) #define rrep2(i,l,r)for(int i=(r) - 1;i>=(l);--i) #define all(x) (x).begin(),(x).end() #define allR(x) (x).rbegin(),(x).rend() #define P pair 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; } template std::pair ternarysearch(T l, T r, const std::function &f) { // 下に凸 while (2 < abs(r - l)) { T ml = (l * 2 + r) / 3; T mr = (l + r * 2) / 3; if (f(ml) < f(mr)) r = mr; else l = ml; } T ret = l; U value = f(l); for (T i = l; i <= r; ++i) { auto tmp = f(i); if (tmp < value) { ret = i; value = tmp; } } return { ret,value }; } long long local(int x, int y) { int tx = 23, ty = 12; return abs(tx - x) + abs(ty - y); } auto query(int x, int y) { std::cout << 1 << " " << x << " " << y; std::cout << std::endl; fflush(stdout); //return local(x, y); long long get; std::cin >> get; return get; } auto answer(int x, int y) { std::cout << 2 << " " << x << " " << y; std::cout << std::endl; fflush(stdout); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; auto f = [&](int x)->long long { return query(x, 0); }; auto[x, xv] = ternarysearch(-1e9, 1e9, f); auto g = [&](int y)->long long { return query(0, y); }; auto[y, yv] = ternarysearch(-1e9, 1e9, g); answer(x, y); return 0; }