#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 132674 + 10;
int n;
struct nod {
  int x, y;
};
nod nua[maxn], nub[maxn];
int l[maxn], r[maxn], u[maxn], d[maxn];
unsigned i, j;
void print(int lc, int dc) {
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (lc >= nua[i].x && lc <= nub[i].x && dc >= nua[i].y && dc <= nub[i].y) {
      ++cnt;
    }
  }
  if (cnt >= n - 1) {
    printf("%d %d\n", lc, dc);
    exit(0);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d %d %d %d", &l[i], &d[i], &r[i], &u[i]);
    nua[i].x = l[i];
    nua[i].y = d[i];
    nub[i].x = r[i];
    nub[i].y = u[i];
  }
  sort(l + 1, l + 1 + n);
  sort(r + 1, r + 1 + n);
  sort(d + 1, d + 1 + n);
  sort(u + 1, u + 1 + n);
  for (i = 1; i <= 2; ++i) {
    for (j = n - 1; j <= n; ++j) {
      print(l[j], u[i]);
      print(r[i], d[j]);
    }
    for (j = 1; j <= 2; ++j) {
      print(l[i], d[j]);
    }
  }
  for (i = n - 1; i <= n; ++i) {
    for (j = n - 1; j <= n; ++j) {
      print(r[i], u[i]);
    }
  }
  return 0;
}
