#include<bits/stdc++.h>
#define REP(i,b,e) for(int i=(b);i<(e);i++)
#define RREP(i,b,e) for(int i=(e)-1;i>=(b);i--)
using T = std::tuple<int,int,int,int>;

int n, X[200], Y[200], R[200];
int put[10000][10000],  scores[4], maxid;
int ltx[200], lty[200], rbx[200], rby[200];
bool row_has[10000], row_has_lazy[10000];
int width[200], height[200];
std::vector<T> ans[4];

void init(){
	REP(i, 0, 10000) row_has[i] = row_has_lazy[i] = false;
	REP(i, 0, n){
		ltx[i] = X[i], lty[i] = Y[i];
		rbx[i] = X[i]+1, rby[i] = Y[i]+1;
		row_has[Y[i]] = true;
		put[X[i]][Y[i]] = i + 1;
	}
}

double calcP(int r, int s){
	double tmp = 1 - std::min(r, s) / (double) std::max(r, s);
	tmp *= tmp;
	return 1 - tmp;
}

int scoring(std::vector<T> arr){
	double sum = 0;
	int idx = 0;
	for(auto [a,b,c,d]: arr) sum += calcP((d-b)*(c-a), R[idx++]) / n;
	return int64_t(sum * 1e9);
}
	

int main(){
    scanf("%d", &n);
	REP(i, 0, n) scanf("%d %d %d", &X[i], &Y[i], &R[i]);
	REP(i, 0, 4) ans[i].resize(n);

	init();
	REP(y, 0, 10000){
		int idx = -1;
		REP(x, 0, 10000){
			if(put[x][y]){
				if(idx>=0) rbx[idx] = x;
				else ltx[put[x][y]-1] = 0;
				idx = put[x][y] - 1;
			}
		}
		if(idx>=0) rbx[idx] = 10000;
	}
	REP(i, 0, n) width[i] = rbx[i] - ltx[i];

	REP(i, 0, n){
		height[i] = 1;
		while(rby[i]<9999 && !row_has[rby[i]] && width[i] * height[i] < R[i]){
			row_has_lazy[rby[i]] = true;
			rby[i]++;
			height[i]++;
		}
	}
	REP(i, 0, 10000) row_has[i] |= row_has_lazy[i];
	RREP(i, 0, n){
		while(lty[i]>0 && !row_has[lty[i]-1] && width[i] * height[i] < R[i]){
			lty[i]--;
			height[i]++;
		}
	}
	REP(i, 0, n) ans[0][i] = {ltx[i], lty[i], rbx[i], rby[i]};
	scores[0] = scoring(ans[0]);


	init();
	REP(y, 0, 10000){
		int idx = -1;
		REP(x, 0, 10000){
			if(put[x][y]){
				if(idx>=0) rbx[idx] = x;
				else ltx[put[x][y]-1] = 0;
				idx = put[x][y]-1;
			}
		}
		if(idx>=0) rbx[idx] = 10000;
	}
	REP(i, 0, n) width[i] = rbx[i] - ltx[i];

	RREP(i, 0, n){
		while(lty[i]>0 && !row_has[lty[i]-1] && width[i] * height[i] < R[i]){
			row_has_lazy[rby[i]] = true;
			lty[i]--;
			height[i]++;
		}
	}
	REP(i, 0, 10000) row_has[i] |= row_has_lazy[i];
	REP(i, 0, n){
		height[i] = 1;
		while(rby[i]<9999 && !row_has[rby[i]] && width[i] * height[i] < R[i]){
			rby[i]++;
			height[i]++;
		}
	}
	REP(i, 0, n) ans[1][i] = {ltx[i], lty[i], rbx[i], rby[i]};
	scores[1] = scoring(ans[1]);
	if(scores[1] > scores[0]) maxid = 1;


	for(auto [a,b,c,d]: ans[maxid]) printf("%d %d %d %d\n", a, b, c, d);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int SIZE = 10000;

template <class T> void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}

template <class T> void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}

struct Rect {
  int x1, y1, x2, y2;
};

struct S {
  int x;
  int y;
  int r;
  Rect rect;
};

int dist(const S& a, const S& b) {
  int x = abs(a.x - b.x);
  int y = abs(a.y - b.y);
  return int(sqrt(x * x + y * y) / 2);
}

void f(vector<S>& v) {
  vector<int> dist_min(v.size(), SIZE);
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v.size(); ++j) {
      if (i == j) {
        continue;
      }
      chmin(dist_min[i], dist(v[i], v[j]));
    }
  }
  for (int i = 0; i < v.size(); ++i) {
    int dx = max(0, int(dist_min[i] / sqrt(2)));
    int dy = dx;
    Rect& r = v[i].rect;
    r.x1 -= dx;
    r.y1 -= dy;
    r.x2 += dx;
    r.y2 += dy;
    chmax(r.x1, 0);
    chmax(r.y1, 0);
    chmin(r.x2, SIZE);
    chmin(r.y2, SIZE);
  }
}

int main() {
  int n;
  cin >> n;

  vector<S> v(n);
  for (int i = 0; i < n; ++i) {
    S& vi = v[i];
    cin >> vi.x >> vi.y >> vi.r;
    vi.rect.x1 = vi.x;
    vi.rect.y1 = vi.y;
    vi.rect.x2 = vi.x + 1;
    vi.rect.y2 = vi.y + 1;
  }

  f(v);

  for (int i = 0; i < n; ++i) {
    Rect& r = v[i].rect;
    printf("%d %d %d %d\n", r.x1, r.y1, r.x2, r.y2);
  }
}
