#include <fstream>
#include <vector>
#include <algorithm>
#define DIM 100010
using namespace std;
ifstream fin("oypara.in");
ofstream fout("oypara.out");
vector< pair<int, int> > P, Q;
pair<int, int> S[DIM];
pair<int, int> aux;
int n, x, y, z, i, cp, cq, ok;
long long det(const pair<int, int> &a, const pair<int, int> &b, const pair<int, int> &c) {
return (1LL*b.first-a.first)*(c.second-a.second) - (1LL*c.first-a.first)*(b.second-a.second);
}
int cmp( const pair<int, int> &a, const pair<int, int> &b ) {
return det(aux, a, b) > 0;
}
void infasuratoare(vector< pair<int, int> > &P) {
int p = 0;
for (int j=0; j<P.size(); j++)
if (P[j].first < P[p].first ||
(P[j].first == P[p].first && P[j].second < P[p].second))
p = j;
aux = P[p];
P[p] = P[0];
P[0] = aux;
sort(P.begin()+1, P.end(), cmp);
S[1] = P[0];
S[2] = P[1];
int k = 2;
for (int j=2;j<P.size();j++) {
while (k >= 2 && det(S[k-1], S[k], P[j]) <= 0 ) {
k--;
}
S[++k] = P[j];
}
P.clear();
while (k) {
P.push_back(S[k--]);
}
}
inline int next(vector< pair<int, int> > &P, int c) {
return ((c!=P.size()-1) ? c+1 : 0);
}
inline int prev(vector< pair<int, int> > &P, int c) {
return ((c==0) ? P.size()-1 : c-1);
}
int main() {
fin>>n;
for (i=1;i<=n;i++) {
fin>>x>>y>>z;
P.push_back(make_pair(x, y));
Q.push_back(make_pair(x, z));
}
infasuratoare(P);
infasuratoare(Q);
/*
for (i=0;i<Q.size();i++)
fout<<Q[i].first<<" "<<Q[i].second<<"\n";
*/
cp = P.size()-1;
cq = 0;
int nxt, prv;
do {
if (((det(P[cp], Q[cq], Q[prev(Q, cq)]) >= 0) && (det(P[cp], Q[cq], Q[next(Q, cq)]) >= 0))
&& !(det( Q[cq], P[cp], P[nxt =next(P, cp)]) <= 0 && det( Q[cq], P[cp], P[prv = prev(P, cp)]) <= 0))
break;
else
cq = prev(Q, cq);
} while(1);
do {
if (det( Q[cq], P[cp], P[nxt =next(P, cp)]) >= 0 && det( Q[cq], P[cp], P[prv = prev(P, cp)]) >= 0) {
ok = 1;
break;
}
cp = next(P, cp);
do {
x=det(P[cp], Q[cq], Q[prv = prev(Q, cq)]);
y=det(P[cp], Q[cq], Q[nxt = next(Q, cq)]);
if ((x >= 0) && (y >= 0))
break;
else
cq = prev(Q, cq);
} while(1);
if (cp == P.size()-1) {
ok = 0;
break;
}
} while (1);
if (P[cp].first <1 || P[cp].first > 100000000) {
fout<<1/(1-1);
}
if (P[cp].second <1 || P[cp].second > 100000000) {
fout<<1/(1-1);
}
if (Q[cp].first <1 || Q[cp].first > 100000000) {
fout<<1/(1-1);
}
if (Q[cp].second <1 || Q[cp].second > 100000000) {
fout<<1/(1-1);
}
fout<<P[cp].first<<" "<<P[cp].second<<" "<<Q[cq].first<<" "<<Q[cq].second<<"\n";
return 0;
}