#include <bits/stdc++.h>
using namespace std;
struct str {
  int x1;
  int y1;
  int x2;
  int y2;
};
bool compare(str &a, str &b) {
  if (a.x1 < b.x1)
    return true;
  else if (a.x1 == b.x1) {
    if (a.x2 < b.x2)
      return true;
    else if (a.x2 == b.x2) {
      if (a.y1 < b.y1)
        return true;
      else if (a.y1 <= b.y1) {
        return (a.y2 < b.y2);
      }
    }
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<str> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].x1 >> v[i].y1 >> v[i].x2 >> v[i].y2;
  }
  sort(v.begin(), v.end(), compare);
  int x11 = v[0].x1;
  int y11 = v[0].y1;
  int x22 = v[0].x2;
  int y22 = v[0].y2;
  int flag = 0, ind = 0, counter = 1;
  for (int i = 1; i < n; i++) {
    int x1 = max(x11, v[i].x1);
    int x2 = min(x22, v[i].x2);
    int y1 = max(y11, v[i].y1);
    int y2 = min(y22, v[i].y2);
    int x1r = x2 - x1;
    int y1r = y2 - y1;
    if ((x1r < 0 || y1r < 0) && !flag) {
      ind = i;
    } else {
      x11 = x1, y11 = y1, x22 = x2, y22 = y2;
      counter++;
    }
  }
  if (counter == n - 1)
    cout << x11 << " " << y11 << endl;
  else {
    x11 = v[ind].x1, y11 = v[ind].y1, x22 = v[ind].x2, y22 = v[ind].y2;
    for (int i = 1; i < n; i++) {
      int x1 = max(x11, v[i].x1);
      int x2 = min(x22, v[i].x2);
      int y1 = max(y11, v[i].y1);
      int y2 = min(y22, v[i].y2);
      int x1r = x2 - x1;
      int y1r = y2 - y1;
      if ((x1r < 0 || y1r < 0) && !flag) {
        ind = i;
      } else {
        x11 = x1, y11 = y1, x22 = x2, y22 = y2;
        counter++;
      }
    }
    cout << x11 << " " << y11 << endl;
  }
}
