#include <bits/stdc++.h>
using namespace std;
int a[200309][4], n;
int maxl[200309][4], maxr[200309][4], minl[200309][4], minr[200309][2];
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; (i) <= int(n); (i)++)
      for (int k = 0; (k) < int(4); (k)++) scanf("%d", &a[i][k]);
    for (int k = 0; (k) < int(4); (k)++) {
      maxl[0][k] = -0x3f3f3f3f;
      minl[0][k] = 0x3f3f3f3f;
      maxr[n + 1][k] = -0x3f3f3f3f;
      minr[n + 1][k] = 0x3f3f3f3f;
    }
    for (int i = 1; (i) <= int(n); (i)++)
      for (int k = 0; (k) < int(4); (k)++) {
        maxl[i][k] = max(a[i][k], maxl[i - 1][k]);
        minl[i][k] = min(a[i][k], minl[i - 1][k]);
      }
    for (int i = (n); (i) > 0; (i)--)
      for (int k = 0; (k) < int(4); (k)++) {
        maxr[i][k] = max(a[i][k], maxr[i + 1][k]);
        minr[i][k] = min(a[i][k], minr[i + 1][k]);
      }
    bool found = false;
    for (int i = 1; (i) <= int(n); (i)++) {
      if (found) break;
      int xb = max(maxl[i - 1][0], maxr[i + 1][0]);
      int yb = max(maxl[i - 1][1], maxr[i + 1][1]);
      int xt = min(minl[i - 1][2], minr[i + 1][2]);
      int yt = min(minl[i - 1][3], minr[i + 1][3]);
      if (xt >= xb && yt >= yb) {
        found = true;
        printf("%d %d\n", xb, yb);
      }
    }
  }
  return 0;
}
