#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
    #include <atcoder/all>
    using namespace atcoder;
#endif

using namespace std;
using Graph = vector<vector<int>>;
using vst= vector<string>;
using vin= vector<int>;
using ll=long long;
using ull=unsigned long long;
using vll= vector<ll>;
using P=pair<int ,int>;
using pqi=priority_queue<int, vector<int>, greater<int>>;
using pqp=priority_queue<P, vector<P>, greater<P>>;

//const long double pi=acos(-1);
#define ft first
#define sd second
#define fn front
#define pb push_back
#define eb emplace_back
#define it insert
#define vvi vector<vector<int>>
#define si(v) int((v).size())
#define pq priority_queue
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rell(i,n) for (ll i=0; i< (ll)(n); i++)
#define sot(x) sort(x.begin(), x.end())
#define rese(x) reverse(x.begin(), x.end())
#define gsot(x) sort(x.begin(), x.end(), greater<ll>());
#define vnn(x,y,s,name) vector<vector<int>> name(x, vector<int>(y,s))
#define mse(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(),(x).end()
#define mii(x,y,z) min(x,min(y,z))
#define maa(x,y,z) max(x,max(y,z))
#define cps CLOCKS_PER_SEC
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define cset(x) cout<<fixed<<setprecision(x)


//const int INF=1001001001;
//const ll INF=1e18;
//998244353  1000000007
void output(int a,int b,int c,int d){
    cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
}


int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    vector<pair<int,P>> a(n);
    
    rep(i,n){
        int x,y,r;
        cin>>x>>y>>r;
        /*int s=ceil(sqrt((double)(r)));
        int t=s/2;*/
        output(x,y,x+1,y+1);
        a[i].ft=r;
        a[i].sd.ft=x;
        a[i].sd.sd=y;
    }
    sot(a);
    
}



















#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;
typedef vector<ld> vld;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}
void OUTX2(){cout << endl;}
template<typename Head, typename... Tail>
void OUTX2(Head&& head, Tail&&... tail)
{
    cout << head << ' ';
    OUTX2(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define __LONG_LONG_MIN__ (-__LONG_LONG_MAX__ - 1)

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

struct dat
{
    ll index;
    ld x;
    ld y;
    ld r;
    ld sqrtr2;
};
typedef vector<dat> vdat;

struct square
{
    ld a;
    ld b;
    ld c;
    ld d;
};
typedef vector<square> vsquare;


int main()
{
    ll n;
    INX(n);

    vdat data(n);
    vdat dataxsort(n);
    vdat dataysort(n);
    vsquare result(n);
    for (ll i = 0; i < n; i++)
    {
        dat &di = data[i];
        INX(di.x, di.y, di.r);
        di.index = i;
        di.sqrtr2 = (ld)sqrt(di.r) / 2.0;
        dataxsort[i] = di;
        dataysort[i] = di;

        square &sqi = result[i];
        sqi.a = di.x;
        sqi.b = di.y;
        sqi.c = di.x + 1.0;
        sqi.d = di.y + 1.0;

    }

    sort(dataxsort.begin(), dataxsort.end(), [](dat d1, dat d2){return d1.x < d2.x;});
    sort(dataysort.begin(), dataysort.end(), [](dat d1, dat d2){return d1.y < d2.y;});

    for (ll i = 0; i < n; i++)
    {
        dat &dx = dataxsort[i];
        square &sqi1 = result[dx.index];
        ll j = i - 1;
        if(i == 0 || dataxsort[i].x == dataxsort[0].x)
        {
            sqi1.a = max((ld)0, sqi1.a - dx.sqrtr2);
        }
        else if(dataxsort[i].x == dataxsort[j].x)
        {
            while(dataxsort[i].x == dataxsort[--j].x);
            square &sqj = result[dataxsort[j].index];
            sqi1.a = max(sqj.c, sqi1.a - dx.sqrtr2);
        }
        else
        {
            square &sqj = result[dataxsort[j].index];
            sqi1.a = max(sqj.c, sqi1.a - dx.sqrtr2);
        }
        sqi1.a = ceil(sqi1.a);

        dat &dy = dataysort[i];
        square &sqi2 = result[dy.index];
        j = i - 1;
        if(i == 0 || dataysort[i].y == dataysort[0].y)
        {
            sqi2.b = max((ld)0, sqi2.b - dy.sqrtr2);
        }
        else if(dataysort[i].y == dataysort[j].y)
        {
            while(dataysort[i].y == dataysort[--j].y);
            square &sqj = result[dataysort[j].index];
            sqi2.b = max(sqj.d, sqi2.b - dy.sqrtr2);
        }
        else
        {
            square &sqj = result[dataysort[j].index];
            sqi2.b = max(sqj.d, sqi2.b - dy.sqrtr2);
        }
        sqi2.b = ceil(sqi2.b);
    }

    

    for (ll i = 0; i < n; i++)
    {
        square &sqi = result[i];
        OUTX2(sqi.a, sqi.b, sqi.c, sqi.d);
    }
    
    return 0;
}
