#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
struct point {
  int x;
  int y;
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<point, point> > rec;
  multiset<int> x1, x2, y1, y2;
  for (int i = 0; i < n; i++) {
    point p1;
    cin >> p1.x >> p1.y;
    point p2;
    cin >> p2.x >> p2.y;
    rec.push_back(make_pair(p1, p2));
    x1.insert(min(p1.x, p2.x));
    x2.insert(max(p1.x, p2.x));
    y1.insert(min(p1.y, p2.y));
    y2.insert(max(p1.y, p2.y));
  }
  for (int i = 0; i < n; i++) {
    point p1 = rec[i].first;
    point p2 = rec[i].second;
    x1.erase(x1.find(min(p1.x, p2.x)));
    x2.erase(x2.find(max(p1.x, p2.x)));
    y1.erase(y1.find(min(p1.y, p2.y)));
    y2.erase(y2.find(max(p1.y, p2.y)));
    if ((*x1.rbegin()) <= (*x2.begin()) and (*y1.rbegin()) <= (*y2.begin())) {
      cout << (*x1.rbegin()) << " " << (*y2.begin());
      break;
    }
    x1.insert(min(p1.x, p2.x));
    x2.insert(max(p1.x, p2.x));
    y1.insert(min(p1.y, p2.y));
    y2.insert(max(p1.y, p2.y));
  }
  return 0;
}
