#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
struct pct {
double x, y;
};
const double eps = 0.0000001;
const int N = 100005;
int n, sts[N], stj[N];
pct sus[N], jos[N];
bool f[N];
void read() {
double x, y1, y2;
scanf("%d", &n);
for (int i = 1; i <= n; ++ i) {
scanf("%lf%lf%lf", &x, &y1, &y2);
sus[i].x = x;
sus[i].y = y2;
jos[i].x = x;
jos[i].y = y1;
}
}
double semn (pct A, pct B, pct C) {
return A.x * B.y - A.x * C.y - A.y * B.x + A.y * C.x + B.x * C.y - B.y * C.x;
}
bool comp(const pct &A, const pct &B) {
if (A.x < B.x) return true;
if (A.x > B.x) return false;
return A.y < B.y;
}
void convex_hull(pct v[N], int st[N]) {
for (int i = 1; i<= n; ++ i)
f[i] = false;
sort(v + 1, v + n + 1, comp);
st[++ st[0]] = 1;
f[1] = true;
st[++ st[0]] = 2;
f[2] = true;
for (int i = 3; i <= n; ++ i) {
while (semn(v[st[st[0]]], v[st[st[0] - 1]], v[i]) <= 0 && st[0] > 1) {
f[st[st[0]]] = false;
-- st[0];
}
st[++ st[0]] = i;
f[i] = true;
}
for (int i = n; i >= 1; -- i)
if (! f[i] || i == 1) {
while (semn(v[st[st[0]]], v[st[st[0] - 1]], v[i]) <= 0 && st[0] > 1) {
f[st[st[0]]] = false;
-- st[0];
}
st[ ++ st[0]] = i;
f[i] = true;
}
}
inline double dist(pct A, pct B) {
return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
inline double unghi_Ox(pct A, pct B) {
double u = asin((B.y - A.y) / dist(A, B)) / M_PI * 180;
//centru xOy = (A.x, A.y)
//cadran 1
if (B.x >= A.x && B.y >= A.y)
return u;
//cadran 2
if (B.x <= A.x && B.y >= A.y)
return (double)180 - u;
//cadran 3
if (B.x <= A.x && B.y <= A.y)
return (double)180 - u;
//cadran 4
return (double)360 + u;
}
inline double unghi_Oy(pct A, pct B) {
double uOx = unghi_Ox(A, B);
//centru xOy = (A.x, A.y)
//partea superioara a infasuratorii => B.x >= A.x => doar cadranele 1 si 4
//cadran 1
if (B.y >= A.y)
return (double)90 - uOx;
//cadran 4
return (double)360 - uOx;
}
inline pct rotire(pct A, double u) {
double ur = u / 180 * M_PI; //unghi in rad
double c = cos(ur), s = sin(ur);
double x1 = (double)A.x * c, x2 = - (double)A.y * s;
double y1 = (double)A.x * s, y2 = (double)A.y * c;
double nx = x1 + x2, ny = y1 + y2;
return (pct){nx, ny};
}
bool verif(pct A, double &max, pct O) {
if (A.x >= O.x + eps) {
if (A.x - O.x >= max) {
max = A.x - O.x;
return true;
}
return false;
}
return false;
}
void solve() {
double uc = unghi_Oy(jos[stj[1]], jos[stj[2]]);
pct pc, A = jos[stj[1]];
int it = 0;
double maxdr = - 1;
for (int j = 1; j <= sts[0]; ++ j) {
pc = rotire(sus[sts[j]], uc);
if (pc.x >= A.x + eps) {
if (pc.x - A.x > maxdr) {
maxdr = pc.x - A.x;
it = j;
}
}
}
if (maxdr == - 1) {
printf("%.0lf %.0lf %.0lf %.0lf\n", jos[stj[1]].x, jos[stj[1]].y, jos[stj[2]].x, jos[stj[2]].y);
return;
}
for (int i = 2; ; ++ i) {
if (stj[i] == n)
break;
A = jos[stj[i]];
uc = unghi_Oy(jos[stj[i]], jos[stj[i + 1]]);
pc = rotire(sus[sts[it]], uc);
maxdr = - 1;
if (pc.x >= A.x + eps)
maxdr = pc.x - A.x;
while (verif(rotire(sus[sts[it + 1]], uc), maxdr, A))
++ it;
if (maxdr == - 1) {
printf("%.0lf %.0lf %.0lf %.0lf\n", jos[stj[i]].x, jos[stj[i]].y, jos[stj[i + 1]].x, jos[stj[i + 1]].y);
return;
}
}
}
int main() {
freopen("oypara.in", "r", stdin);
freopen("oypara.out", "w", stdout);
read();
convex_hull(sus, sts);
convex_hull(jos, stj);
solve();
return 0;
}