#include <bits/stdc++.h>
using namespace std;
const int SN = 1 << 20;
struct nodes {
  int x1, x2, y1, y2;
};
nodes segtree[SN];
nodes arr[132800];
nodes dummy;
nodes merge(nodes a, nodes b) {
  nodes temp;
  temp.x1 = max(a.x1, b.x1);
  temp.x2 = min(a.x2, b.x2);
  temp.y1 = max(a.y1, b.y1);
  temp.y2 = min(a.y2, b.y2);
  return temp;
}
void build(int l, int r, int node) {
  if (l == r) {
    segtree[node] = arr[l];
  } else {
    int mid = (l + r) >> 1;
    build(l, mid, node << 1LL);
    build(mid + 1, r, node << 1LL | 1LL);
    segtree[node] = merge(segtree[node << 1LL], segtree[(node << 1LL) | 1LL]);
  }
}
nodes query(int l, int r, int node, int ql, int qr) {
  if (l > qr || r < ql) {
    return dummy;
  }
  if (l >= ql && r <= qr) {
    return segtree[node];
  }
  int mid = (l + r) >> 1;
  nodes a = query(l, mid, node << 1LL, ql, qr);
  nodes b = query(mid + 1, r, node << 1LL | 1LL, ql, qr);
  nodes temp;
  temp = merge(a, b);
  return temp;
}
bool valid(nodes a) {
  if (a.x1 <= a.x2 and a.y1 <= a.y2) {
    return true;
  }
  return false;
}
void pout(nodes a) { cout << a.x1 << " " << a.y1 << endl; }
int main() {
  int n;
  cin >> n;
  dummy.x1 = INT_MIN;
  dummy.x2 = INT_MAX;
  dummy.y1 = INT_MIN;
  dummy.y2 = INT_MAX;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].x1 >> arr[i].y1;
    cin >> arr[i].x2 >> arr[i].y2;
  }
  build(0, n - 1, 1);
  nodes a, b, c;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      a = query(0, n - 1, 1, 1, n - 1);
      if (valid(a)) {
        pout(a);
        break;
      }
    } else if (i == n - 1) {
      a = query(0, n - 1, 1, 0, n - 2);
      if (valid(a)) {
        pout(a);
        break;
      }
    } else {
      a = query(0, n - 1, 1, 0, i - 1);
      b = query(0, n - 1, 1, i + 1, n - 1);
      c = merge(a, b);
      if (valid(c)) {
        pout(c);
        break;
      }
    }
  }
}
