#include <bits/stdc++.h>
using namespace std;
void speedup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
long long expo(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b % 2 == 1) res = (res * a) % m;
    a = (a * a) % m;
    b /= 2;
  }
  return res % m;
}
vector<pair<long long, long long> > rig, down;
vector<pair<pair<long long, long long>, pair<long long, long long> > > v;
long long n;
bool check(pair<long long, long long> p) {
  long long i, cnt = 0;
  for (i = 0; i < n; i++) {
    if (p.first <= v[i].first.first && p.first >= v[i].second.first) {
      if (p.second <= v[i].first.second && p.second >= v[i].second.second) {
        cnt++;
      }
    }
  }
  if (cnt >= n - 1) return true;
  return false;
}
int main() {
  speedup();
  cin >> n;
  long long i, a, b, c, d;
  for (i = 0; i < n; i++) {
    cin >> c >> d >> a >> b;
    v.push_back({{a, b}, {c, d}});
    rig.push_back({a, b});
    down.push_back({d, c});
  }
  sort(rig.begin(), rig.end());
  sort(down.begin(), down.end(), greater<pair<long long, long long> >());
  pair<long long, long long> op1 = {rig[0].first, down[0].first};
  pair<long long, long long> op2 = {rig[1].first, down[0].first};
  pair<long long, long long> op3 = {rig[0].first, down[1].first};
  pair<long long, long long> op4 = {rig[1].first, down[1].first};
  if (check(op1))
    cout << op1.first << " " << op1.second;
  else if (check(op2))
    cout << op2.first << " " << op2.second;
  else if (check(op3))
    cout << op3.first << " " << op3.second;
  else if (check(op4))
    cout << op4.first << " " << op4.second;
  return 0;
}
