#include <cstdio>
#include <vector>
#include <algorithm>
#define DIM 100010
using namespace std;
FILE *fin = fopen("oypara.in", "r");
FILE *fout = fopen("oypara.out", "w");
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 okSus(int cp, int cq) {
if (P[cp].first < Q[cq].first) {
if ((det(P[cp], Q[cq], Q[prev(Q, cq)]) >= 0) && (det(P[cp], Q[cq], Q[next(Q, cq)]) >= 0))
return 1;
} else {
if ((det(P[cp], Q[cq], Q[prev(Q, cq)]) <= 0) && (det(P[cp], Q[cq], Q[next(Q, cq)]) <= 0))
return 1;
}
return 0;
}
int okJos(int cp, int cq) {
int nxt, prv;
if (P[cp].first < Q[cq].first) {
if (det( Q[cq], P[cp], P[nxt =next(P, cp)]) >= 0 && det( Q[cq], P[cp], P[prv = prev(P, cp)]) >= 0)
return 1;
} else {
if (det( Q[cq], P[cp], P[nxt =next(P, cp)]) <= 0 && det( Q[cq], P[cp], P[prv = prev(P, cp)]) <= 0)
return 1;
}
return 0;
}
int main() {
fscanf(fin,"%d",&n);
for (i=1;i<=n;i++) {
fscanf(fin,"%d%d%d",&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 (okSus(cp, cq))
break;
else
cq = prev(Q, cq);
} while(1);
do {
if (okJos(cp, cq)) {
ok = 1;
break;
}
cp = next(P, cp);
do {
if (okSus(cp, cq))
break;
else
cq = prev(Q, cq);
} while(1);
if (cp == P.size()-1) {
ok = 0;
break;
}
} while (1);
fprintf(fout,"%d %d %d %d\n",P[cp].first, P[cp].second, Q[cq].first, Q[cq].second);
return 0;
}