#include <bits/stdc++.h>
using namespace std;
struct rectangle {
  int x1, y1, x2, y2;
} rec[200000], pre[200000], suf[200000];
rectangle insec(rectangle a, rectangle b) {
  return (rectangle){max(a.x1, b.x1), max(a.y1, b.y1), min(a.x2, b.x2),
                     min(a.y2, b.y2)};
}
void out(rectangle a) {
  if (a.x1 <= a.x2 && a.y1 <= a.y2) {
    printf("%d %d\n", a.x1, a.y1);
    exit(0);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d%d", &rec[i].x1, &rec[i].y1, &rec[i].x2, &rec[i].y2);
  pre[1] = rec[1];
  for (int i = 2; i <= n; i++) pre[i] = insec(pre[i - 1], rec[i]);
  suf[n] = rec[n];
  for (int i = n - 1; i >= 1; i--) suf[i] = insec(suf[i + 1], rec[i]);
  out(pre[n - 1]);
  out(suf[2]);
  for (int i = 2; i < n; i++) out(insec(pre[i - 1], suf[i + 1]));
  return 0;
}
