#line 1 "/home/siro53/kyo-pro/compro_library/template/template.cpp"
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
#define DEBUG
#ifdef DEBUG
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << '(' << p.first << ',' << p.second << ')';
    return os;
}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for(int i = 0; i < (int)v.size(); i++) {
        if(i) { os << ','; }
        os << v[i];
    }
    os << '}';
    return os;
}
void debugg() { cerr << endl; }
template <class T, class... Args>
void debugg(const T &x, const Args &... args) {
    cerr << " " << x;
    debugg(args...);
}
#define debug(...)                                                             \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]: ", debugg(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

struct Setup {
    Setup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __Setup;

using ll = long long;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define FOR(i, a, b) for(int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------
#line 1 "/home/siro53/kyo-pro/compro_library/util/get_time.hpp"
inline double get_time() {
    const double ticks_per_sec = 2500000000;
    uint32_t lo, hi;
    asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
    return (((uint64_t)hi << 32) | lo) / ticks_per_sec;
}


#line 1 "/home/siro53/kyo-pro/compro_library/util/randint.hpp"
struct random_number_generator {
    mt19937 mt;
    random_number_generator():mt(chrono::steady_clock::now().time_since_epoch().count()) {}
    int operator()(int a, int b) {
        uniform_int_distribution<int> dist(a, b - 1);
        return dist(mt);
    }
    int operator()(int b) {
        return (*this)(0, b);
    }
};
#line 4 "main.cpp"

struct P{
    int x, y;
    P(){}
    P(int x, int y):x(x), y(y) {}
};

struct Ad {
    P p1, p2;
    Ad(){}
    Ad(int a, int b, int c, int d):p1(a, b), p2(c, d) {}
    Ad(P p1, P p2):p1(p1), p2(p2) {}
};

random_number_generator rng;
int N;
int x[200], y[200], r[200];
Ad ad[200];

void input() {
    cin >> N;
    REP(i, N) cin >> x[i] >> y[i] >> r[i];
}

void output() {
    REP(i, N) {
        cout << ad[i].p1.x << " " << ad[i].p1.y << " " << ad[i].p2.x << " " << ad[i].p2.y << "\n";
    }
}

void solve() {
    REP(i, N) {
        ad[i] = Ad(x[i], y[i], x[i]+1, y[i]+1);
    }
}

int main() {
    input();
    solve();
    output();
}

#include <bits/stdc++.h>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
using ld = long double;
unsigned long xor128() {
  static unsigned long x=time(NULL), y=362436069, z=521288629, w=88675123;
  unsigned long t=(x^(x<<11));
  x=y; y=z; z=w;
  return ( w=(w^(w>>19))^(t^(t>>8)) );
}


typedef struct Sponsor{
    int x;
    int y;
    int area;
} Sponsor;
typedef struct AD{
    int x;
    int y;
    int dx;
    int dy;
    Sponsor sponsor;
} AD;

inline bool check_intersect(AD a,AD b){
    bool ans = (min(a.x,b.x) <= max(a.x,b.x) and max(a.x,b.x) < min(a.x+a.dx,b.x + b.dx));
    ans &= (min(a.y,b.y) <= max(a.y,b.y) and max(a.y,b.y) < min(a.y+a.dy,b.y + b.dy));
    return ans;
}
bool validate(vector<AD> inputs){
    for(int i = 0;i < inputs.size();++i){
        if(inputs[i].x + inputs[i].dx > 10000 or inputs[i].y + inputs[i].dy > 10000) return false;
        for(int q = i+1;q < inputs.size();++q){
            if(check_intersect(inputs[i],inputs[q]) == true) return false;
        }
    }
    return true;
}
ld scoring(vector<AD> inputs,ld border){
    ld ans = 0;
    for(int i = 0;i < inputs.size();++i){
        if(inputs[i].x <= inputs[i].sponsor.x and inputs[i].sponsor.x < inputs[i].x + inputs[i].dx
            and inputs[i].y <= inputs[i].sponsor.y and inputs[i].sponsor.y < inputs[i].y + inputs[i].dy){
                ld real_area = inputs[i].dx * inputs[i].dy;
                ld expected_area = inputs[i].sponsor.area;
                ans += 1.0L - abs(border - pow(1 - min(real_area,expected_area)/max(real_area,expected_area),2.0));
            }else return -1;
    }
    ans /= (ld)inputs.size();
    return ans;
}

int main(){
    int n;
    cin >> n;
    vector<AD> inputs;
    REP(i,n){
        int a,b,c;
        cin >> a >> b >> c;
        inputs.push_back(AD{a,b,1,1,Sponsor{a,b,c}});
    }
    ld now_score = scoring(inputs,0);
    for(int i = 0;i < 3000000;++i){
        int target = xor128() % inputs.size();
        AD tmp = inputs[target];
        int dir = xor128() % 6;
        int step = xor128() % 200 - 100;
        if(i % 20000 != 0){
            if(dir == 0){
                inputs[target].dx += step;
            }else if(dir == 1){
                inputs[target].dy += step;
            }else if(dir == 2){
                inputs[target].x -= step;
                inputs[target].dx += step;
            }else if(dir == 3){
                inputs[target].y -= step;
                inputs[target].dy += step;
            }else if(dir == 4){
                inputs[target].x += step;
            }else if(dir == 5){
                inputs[target].y += step;
            }
        }
        bool ok = true;
        for(int q = 0;q < inputs.size();++q){
            if(q != target and check_intersect(inputs[q],inputs[target]) == true){
                ok = false;
            }
        }
        if(inputs[target].dx <= 0 or inputs[target].dy <= 0 or inputs[target].x < 0 or inputs[target].y < 0) ok = false;
        if(inputs[target].x + inputs[target].dx > 10000 or inputs[target].y + inputs[target].dy > 10000) ok = false;
        ld score = 0;
        int hoge = (ld)(3000000.0 - i) / 300000.0;
        ld prob = hoge / 10.0;
        prob *= prob;
        score = scoring(inputs,prob) + (1.00L - prob);
        if(ok and score >= now_score){
            now_score = score;
        }else{
            inputs[target] = tmp;
        }
    }
    for(int i = 0;i < n;++i){
        cout << inputs[i].x << " " << inputs[i].y << " " << inputs[i].x + inputs[i].dx << " " << inputs[i].y + inputs[i].dy << endl;
    }
}