#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> x(n);
	vector<int> y(n);
	vector<int> r(n);
	for (int i = 0; i < n; i++) {
		cin >> x.at(i) >> y.at(i) >> r.at(i);
	}
	int maxx = 0;
	int minx = 114514;
	for (int i = 0; i < n; i++) {
		maxx = max(maxx, x.at(i));
		minx = min(minx, x.at(i));
	}
	int maxi = 0;
	int mini = 0;
	for (int i = 0; i < n; i++) {
		if (x.at(i) == maxx) {
			maxi = i;
			break;
		}
	}
	for (int i = 0; i < n; i++) {
		if (x.at(i) == minx) {
			mini = i;
			break;
		}
	}
	for (int i = 0; i < n; i++) {
		if (i == maxi) {
			cout << maxx << " " << 0 << " " << 10000 << " " << 10000 << endl;
		}
		else if(i == mini){
			cout << 0 << " " << 0 << " " << minx << " " << 10000 << endl;
		}
		else if (x.at(i) == maxx && i != maxi) {
			cout << x.at(i) - 1 << " " << y.at(i) << " " << x.at(i) << " " << y.at(i)+1 << endl;
		}
		else if (x.at(i) == minx && i != mini) {
			cout << x.at(i)+1 << " " << y.at(i) << " " << x.at(i)+2 << " " << y.at(i) + 1 << endl;
		}
		else {
			cout << x.at(i) << " " << y.at(i) << " " << x.at(i) + 1 << " " << y.at(i) + 1 << endl;
		}
	}
}
#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int MOD2 = 998'244'353;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

template<class T, class S> inline bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S> inline bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}










int main(){
    int n; std::cin >> n;
    int x, y, r;
    for(int i(0); i < n; ++i){
        std::cin >> x >> y >> r;
        std::cout << x << " " << y << " " << x + 1 << " " << y + 1 << "\n";
    }
    return 0;
}
