#include<bits/stdc++.h>

using namespace::std;

class Advertisement{
    public:
        void set_val(int x,int y,int inr);
        long get_height();
        long get_width();
        long a;
        long b;
        long c;
        long d;
        long s;
        long r;
};

void Advertisement::set_val(int x,int y,int inr){
    a = x;
    b = y;
    c = x+1;
    d = y+1;
    r = inr;
    s = 1;
}

long Advertisement::get_width(){
    return d-b;
}

long Advertisement::get_height(){
    return c-a;
}

int main(){
    long n;
    cin >> n;
    long x,y,r;
    Advertisement *ad = new Advertisement[n];
    for(int i=0;i<n;i++){
        cin >> x >> y >> r;
        ad[i].set_val(x,y,r);
    }
    for(int i=0;i<n;i++){
        cout << ad[i].a << ' ' << ad[i].b << ' ' << ad[i].c << ' ' << ad[i].d << ' ' << endl;
    }
}

#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;
}
