#include <bits/stdc++.h>
using namespace std;
struct rect {
  int x, y, id;
};
rect a[150005];
rect b[150005];
bool flag = false;
void ck(int x1, int y1, int x2, int y2) {
  if (x1 <= x2 && y1 <= y2 && !flag) {
    printf("%d %d", x1, y1);
    flag = true;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x >> a[i].y >> b[i].x >> b[i].y;
  }
  int mx1 = -1e9;
  int mx2 = -1e9;
  int id1 = 0;
  for (int i = 1; i <= n; i++) {
    if (mx1 < a[i].x) {
      mx2 = mx1;
      mx1 = a[i].x;
      id1 = i;
    } else {
      if (mx2 < a[i].x) {
        mx2 = a[i].x;
      }
    }
  }
  int mxx1 = -1e9;
  int mxx2 = -1e9;
  int id2 = 0;
  for (int i = 1; i <= n; i++) {
    if (mxx1 < a[i].y) {
      mxx2 = mxx1;
      mxx1 = a[i].y;
      id2 = i;
    } else {
      if (mxx2 < a[i].y) {
        mxx2 = a[i].y;
      }
    }
  }
  int mn1 = 1e9;
  int mn2 = 1e9;
  int id3 = 0;
  for (int i = 1; i <= n; i++) {
    if (mn1 > b[i].x) {
      mn2 = mn1;
      mn1 = b[i].x;
      id3 = i;
    } else {
      if (mn2 > b[i].x) {
        mn2 = b[i].x;
      }
    }
  }
  int mnn1 = 1e9;
  int mnn2 = 1e9;
  int id4 = 0;
  for (int i = 1; i <= n; i++) {
    if (mnn1 > b[i].y) {
      mnn2 = mnn1;
      mnn1 = b[i].y;
      id4 = i;
    } else {
      if (mnn2 > b[i].y) {
        mnn2 = b[i].y;
      }
    }
  }
  int x1 = 0;
  int x2 = 0;
  int y1 = 0;
  int y2 = 0;
  for (int i = 1; i <= n; i++) {
    if (id1 == i) {
      x1 = mx2;
    } else
      x1 = mx1;
    if (id2 == i) {
      y1 = mxx2;
    } else
      y1 = mxx1;
    if (id3 == i) {
      x2 = mn2;
    } else
      x2 = mn1;
    if (id4 == i) {
      y2 = mnn2;
    } else
      y2 = mnn1;
    ck(x1, y1, x2, y2);
  }
}
