#include <bits/stdc++.h>
using namespace std;
int a[133000], b[133000];
int c[133000], d[133000];
int main() {
  int N;
  scanf("%d", &N);
  int maxx1 = INT_MIN, maxx2 = INT_MIN;
  int maxy1 = INT_MIN, maxy2 = INT_MIN;
  int minx1 = INT_MAX, minx2 = INT_MAX;
  int miny1 = INT_MAX, miny2 = INT_MAX;
  for (int i = 1; i <= N; i++) scanf("%d%d%d%d", &a[i], &b[i], &c[i], &d[i]);
  for (int i = 1; i <= N; i++) {
    if (a[i] > maxx1) {
      maxx2 = maxx1;
      maxx1 = a[i];
    } else if (a[i] > maxx2)
      maxx2 = a[i];
    if (b[i] > maxy1) {
      maxy2 = maxy1;
      maxy1 = b[i];
    } else if (b[i] > maxy2)
      maxy2 = b[i];
    if (c[i] < minx1) {
      minx2 = minx1;
      minx1 = c[i];
    } else if (c[i] < minx2)
      minx2 = c[i];
    if (d[i] < miny1) {
      miny2 = miny1;
      miny1 = d[i];
    } else if (d[i] < miny2)
      miny2 = d[i];
  }
  for (int i = 1; i <= N; i++) {
    int xs = a[i] == maxx1 ? maxx2 : maxx1;
    int ys = b[i] == maxy1 ? maxy2 : maxy1;
    int xe = c[i] == minx1 ? minx2 : minx1;
    int ye = d[i] == miny1 ? miny2 : miny1;
    if (xs <= xe && ys <= ye) {
      printf("%d %d\n", xs, ys);
      break;
    }
  }
  return 0;
}
