#include <bits/stdc++.h>
using namespace std;
struct rect {
  int x1, x2;
  int y1, y2;
};
rect* intersect(rect* r1, rect* r2) {
  if (r1 == nullptr || r2 == nullptr) {
    return nullptr;
  }
  if (r1->x1 > r2->x2 || r1->x2 < r2->x1) {
    return nullptr;
  }
  if (r1->y1 > r2->y2 || r1->y2 < r2->y1) {
    return nullptr;
  }
  struct rect* temp = (rect*)malloc(sizeof(struct rect));
  temp->x1 = max(r1->x1, r2->x1);
  temp->y1 = max(r1->y1, r2->y1);
  temp->x2 = min(r1->x2, r2->x2);
  temp->y2 = min(r1->y2, r2->y2);
  return temp;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  struct rect* rectangles[n];
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    rect* temp = (rect*)malloc(sizeof(struct rect));
    temp->x1 = x1;
    temp->y1 = y1;
    temp->x2 = x2;
    temp->y2 = y2;
    rectangles[i] = temp;
  }
  rect* pre[n];
  pre[0] = rectangles[0];
  rect* suf[n];
  suf[n - 1] = rectangles[n - 1];
  for (int i = 1; i < n; i++) {
    pre[i] = intersect(pre[i - 1], rectangles[i]);
  }
  for (int i = n - 2; i >= 0; i--) {
    suf[i] = intersect(suf[i + 1], rectangles[i]);
  }
  if (suf[1] != nullptr) {
    cout << suf[1]->x1 << " " << suf[1]->y1 << endl;
    return 0;
  } else if (pre[n - 2] != nullptr) {
    cout << pre[n - 2]->x1 << " " << pre[n - 2]->y1 << endl;
    return 0;
  }
  for (int i = 1; i < n - 1; i++) {
    rect* inter = (rect*)malloc(sizeof(struct rect));
    if (pre[i - 1] != nullptr) {
      inter = intersect(pre[i - 1], suf[i + 1]);
    }
    if (inter != nullptr) {
      cout << inter->x1 << " " << inter->y1 << endl;
      break;
    }
  }
  return 0;
}
