#include<iostream>
using namespace std;
int main()
{
  int n,x[201],y[201],a[201],b[201],c[201],d[201];
  int i,j,rr;
  long long int r[201];
  cin >> n;
  for(i=0;i<n;i++){
    cin >> x[i] >> y[i] >> r[i];
    if(x[i]==0 || y[i]==0){
      if(x[i]==0 && y[i]==0){
        a[i]=b[i]=0;
        c[i]=x[i]+1;
        d[i]=y[i]+1;
      }
      else if(x[i]==0){
        a[i]=0;
        b[i]=y[i]-1;
        c[i]=x[i]+1;
        d[i]=y[i]+1;
      }
      else if(y[i]==0){
        a[i]=x[i]-1;
        b[i]=0;
        c[i]=x[i]+1;
        d[i]=y[i]+1;
      }
    }
    else{
      a[i]=x[i]-1;
      b[i]=y[i]-1;
      c[i]=x[i]+1;
      d[i]=y[i]+1;
    }
  }
  int aflag,bflag,cflag,dflag;
    for(i=0;i<n;i++){
      aflag=bflag=cflag=dflag=0;
      rr=(c[i]-a[i])*(d[i]-b[i]);
      while((aflag!=1 || bflag!=1 || cflag!=1 || dflag!=1) && rr<r[i]+500){
        if(aflag==0) a[i]--;
        if(bflag==0) b[i]--;
        if(cflag==0) c[i]++;
        if(dflag==0) d[i]++;
        for(j=0;j<n;j++){
          if(i!=j){
            if(a[i]<0){
              a[i]=0;
              aflag=1;
            }
            if(b[i]<0){
              b[i]=0;
              bflag=1;
            }
            if(c[i]>10000){
              c[i]=10000;
              cflag=1;
            }
            if(d[i]>10000){
              d[i]=10000;
              dflag=1;
            }
            if(a[i]<=a[j] && b[i]<=b[j] && c[i]>=c[j] && d[i]>=d[j]){
              if(c[j]<x[i]){
                a[i]=c[j];
                aflag=1;
              }
              else if(a[j]>x[i]){
                c[i]=a[j];
                cflag=1;
              }
              else if(b[j]<y[i]){
                b[i]=d[j];
                bflag=1;
              }
              else if(b[j]>y[i]){
                d[i]=b[j];
                dflag=1;
              }
            }
            if((a[j]>=a[i] && a[j]<c[i]) && (b[j]>=b[i] && d[j]<=d[i])){//右
              c[i]--;
              cflag=1;
            }
            else if((a[j]>=a[i] && c[j]<=c[i]) && (b[j]>=b[i] && b[j]<d[i])){//下
              d[i]--;
              dflag=1;
            }
            else if((a[j]>=a[i] && c[j]<=c[i]) && (d[j]>b[i] && d[j]<=d[i])){//上
              b[i]++;
              bflag=1;
              }
            else if((c[j]>a[i] && c[j]<=c[i]) && (b[j]>=b[i] && d[j]<=d[i])){//左
              a[i]++;
              aflag=1;
            }
            if((a[i]>=a[j] && a[i]<c[j]) && (b[i]>=b[j] && b[i]<d[j])){//左上
              if((c[j]-a[i])<=(d[j]-b[i])){
                a[i]++;
                aflag=1;
              }
              if((c[j]-a[i])>=(d[j]-b[i])){
                b[i]++;
                bflag=1; 
              }
            }
            else if((a[i]>=a[j] && a[i]<c[j]) && (d[i]>b[j] && d[i]<=d[j])){//左下
              if((c[j]-a[i])<=(d[i]-b[j])){
                a[i]++;
                aflag=1;
              }
              if((c[j]-a[i])>=(d[i]-b[j])){
                d[i]--;
                dflag=1;
              }
            }
            else if((c[i]>a[j] && c[i]<=c[j]) && (d[i]>b[j] && d[i]<=d[j])){//右下
              if((c[i]-a[j])<=(d[i]-b[j])){
                c[i]--;
                cflag=1;
              }
              if((c[i]-a[j])>=(d[i]-b[j])){
                d[i]--;
                dflag=1;
              }
            }
            else if((c[i]>a[j] && c[i]<=c[j]) && (b[i]>=b[j] && b[i]<d[j])){//右上
              if((c[i]-a[j])<=(d[j]-b[i])){
                c[i]--;
                cflag=1;
              }
              if((c[i]-a[j])>=(d[j]-b[i])){
                b[i]++;
                bflag=1;
              }
            }
          }
        }
        rr=(c[i]-a[i])*(d[i]-b[i]);
      }
    }
  for(i=0;i<n;i++){
    cout << a[i] << " " << b[i] << " " << c[i] << " " << d[i] << endl;
  }
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n;
    cin >> n;
    vector<ll> x(n);
    vector<ll> y(n);
    vector<ll> r(n);
    for(int i = 0;i < n;i++)cin >> x[i] >> y[i] >> r[i];
    for(int i = 0;i < n;i++){
        ll xsi = 0;
        ll ysi = 0;
        ll xmin = 10000;
        ll ymin = 10000;
        for(int j = 0;j < n;j++){
            if(x[i] < x[j])xmin = min(xmin,x[j]);
            if(y[i] < y[j])ymin = min(ymin,y[j]);
        }
        //if(xmin * ymin > r[i])xmin = max((ll)1,r[i] / ymin - 1);
        /*while(1){
            bool can = true;
            for(int j = 0;j < n;j++){
                if(i == j || (x[i] > x[j] && y[i] > y[j]))continue;
                if(x[j] <= x[i] + xsi && y[j] <= y[i] + ysi){
                    can = false;
                    j = n;
                }
            }
            if(!can || xsi * ysi >= r[i] || x[i] + xsi >= 10000 || y[i] + ysi >= 10000)break;
            xsi++,ysi++;
        }*/
        cout << x[i] << " " << y[i] << " " << xmin << " " << ymin << endl;
    }
}