#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include <cassert>
#include <numeric>
#include <unordered_map>
//#include <atcoder/all>
#include <queue>
#include <math.h>
#include <climits>
#include <set>
#include <map>
//using namespace atcoder;

typedef long long ll;
#define FOR(i, a, b) for(ll i=(a); i<(b);i++)
#define REP(i, n) for(ll i=0; i<(n);i++)
#define ROF(i, a, b) for(ll i=(b-1); i>=(a);i--)
#define PER(i, n) for(ll i=n-1; i>=0;i--)
#define REPREP(i,j,a,b) for(ll i=0;i<a;i++)for(ll j=0;j<b;j++)
#define VV(type) vector<vector<type>>
#define VV2(type,n,m,val) vector<vector<type>> val;val.resize(n);for(ll i;i<n;i++)val[i].resize(m)
#define vec(type) vector<type>
#define VEC(type,n,val) vector<type> val;val.resize(n)
#define VL vector<ll>
#define SZ size()
#define all(i) begin(i),end(i)
#define SORT(i) sort(all(i))
#define max(a,b) a>b?a:b
using namespace std;



int main() {
  ll n;
  cin >> n;
  VL x(n),y(n),r(n);
  ll mi = n;
  ll mx = 0;
  REP(i, n) {
    cin >> x[i] >> y[i] >> r[i];
    if (mx < r[i]) {
      mx = r[i];
      mi = i;
    }
  }
  if (1.25*1e9 < mx * n) {
    REP(i, n) {
      if (i == mi) {
        cout << x[(i + 0) % n] <<" "<< y[(i + 0) % n] << " " << x[(i + 0) % n] + 1 << " " << y[(i + 0) % n] + 1<<endl;
      }
      else if ((i + 1) % n == mi) {
        cout << x[(i + 2) % n] << " " << y[(i + 2) % n] << " " << x[(i + 2) % n] + 1 << " " << y[(i + 2) % n] + 1 << endl;
      }
      else {
        cout << x[(i + 1) % n] << " " << y[(i + 1) % n] << " " << x[(i + 1) % n] + 1 << " " << y[(i + 1) % n] + 1 << endl;
      }
    }
  }
  else {
    REP(i, n) {
      cout << x[(i + 1) % n] << " " << y[(i + 1) % n] << " " << x[(i + 1) % n] + 1 << " " << y[(i + 1) % n] + 1 << endl;
    }
  }


  return 0;
}

#include <bits/stdc++.h>
using namespace std;

struct ad {
    int x;
    int y;
    int r;
    ad(int _x = 0, int _y = 0, int _r = 0) : x(_x), y(_y), r(_r) {}

    int left;
    int up;
    int right;
    int down;

    int& operator[](int i) {
        if (i == 0) {
            return left;
        } else if (i == 1) {
            return up;
        } else if (i == 2) {
            return right;
        } else {
            assert(i == 3);
            return down;
        }
    }

    double score() {
        int s = (right - left) * (down - up);
        return 1.0 - pow(1.0 - min(s, r) * 1.0 / max(s, r), 2);
    }
};

bool intersect(ad a, ad b) {
    if (a.right < b.left || b.right < a.left) {
        return false;
    }
    if (a.down < b.up || b.down < a.up) {
        return false;
    }
    return true;
}

vector<int> get_intersect(ad b, const vector<ad>& a) {
    int n = (int)a.size();
    vector<int> res;
    for (int i = 0; i < n; i++) {
        if (intersect(a[i], b)) {
            res.emplace_back(i);
        }
    }
    return res;
}

int main() {
    long long start_time = clock();
    int n;
    cin >> n;
    vector<ad> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].x >> a[i].y >> a[i].r;
        a[i].left = a[i].x;
        a[i].right = a[i].x + 1;
        a[i].up = a[i].y;
        a[i].down = a[i].y + 1;
    }
    vector<int> order(n);
    iota(order.begin(), order.end(), 0);
    sort(order.begin(), order.end(), [&](int i, int j) { return a[i].r < a[j].r; });

    auto modify = [&](int i, int k, int d = 1) {
        ad b = a[i];
        if (k >= 2) {
            a[i][k] += d;
        } else {
            a[i][k] -= d;
        }
        /*
        if (k == 0) {
            a[i].left -= d;
        } else if (k == 1) {
            a[i].up -= d;
        } else if (k == 2) {
            a[i].right += d;
        } else {
            a[i].down += d;
        }
        */
        bool ok = true;
        for (int j = 0; j < n; j++) {
            if (i != j && intersect(a[i], a[j])) {
                ok = false;
            }
        }
        if (min(a[i].left, a[i].up) < 0 || max(a[i].right, a[i].down) > 9999) {
            ok = false;
        }
        if (!ok) {
            swap(a[i], b);
        }
        return ok;
    };

    int tt = 10000;
    while (tt--) {
        long long now = clock();
        if (now - start_time > 4900 * 1000) {
#ifndef tabr
            break;
#endif
        }
        for (int i : order) {
            ad b = a[i];
            b.right++;
            double cur = a[i].score();
            double lr = b.score();
            b.right--;
            b.up--;
            double ud = b.score();
            vector<double> d(4);
            d[0] = d[2] = (lr - cur);
            d[1] = d[3] = (ud - cur);
            for (int k = 0; k < 4; k++) {
                b = a[i];
                if (k >= 2) {
                    b[k] = 9999;
                    b[k ^ 2] = a[i][k] + 1;
                } else {
                    b[k] = 0;
                    b[k ^ 2] = a[i][k] - 1;
                }
                vector<int> t = get_intersect(b, a);
                int c = 10000;
                for (int j : t) {
                    c = min(c, abs(a[i][k] - a[j][k ^ 2]));
                }
                d[k] *= c;
            }
            double mx = *max_element(d.begin(), d.end());
            if (mx <= 0) {
                continue;
            }
            for (int j = 0; j < 4; j++) {
                if (mx - d[j] < 1e-9) {
                    modify(i, j, 1);
                }
            }
        }
    }

    double t = 0;
    for (int i = 0; i < n; i++) {
        cout << a[i].left << " " << a[i].up << " " << a[i].right << " " << a[i].down << '\n';
        t += a[i].score();
    }
    cerr << fixed << setprecision(6);
    cerr << t / n * 1e9 << '\n';
    return 0;
}