#include <bits/stdc++.h>
using namespace std;
const int N = int(2e5 + 5);
int x[N], xx[N], y[N], yy[N];
multiset<int> maxL, minR, maxD, minU;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> xx[i] >> yy[i];
    maxL.insert(x[i]);
    minR.insert(xx[i]);
    maxD.insert(y[i]);
    minU.insert(yy[i]);
  }
  for (int i = 0; i < n; i++) {
    maxL.erase(maxL.find(x[i]));
    minR.erase(minR.find(xx[i]));
    maxD.erase(maxD.find(y[i]));
    minU.erase(minU.find(yy[i]));
    int xL = *maxL.rbegin();
    int xR = *minR.begin();
    int yL = *maxD.rbegin();
    int yR = *minU.begin();
    if (xL <= xR && yL <= yR) {
      cout << xL << " " << yL << endl;
      return 0;
    }
    maxL.insert(x[i]);
    minR.insert(xx[i]);
    maxD.insert(y[i]);
    minU.insert(yy[i]);
  }
  return 0;
}
