#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1e6;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
using namespace std;
long long binpow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans *= a;
    a *= a;
    n >>= 1;
  }
  return ans;
}
long long n, x[MAXN], y[MAXN], x1[MAXN], asdasdaadsdasads[MAXN];
vector<long long> v1, v2, vans1, vans2;
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i] >> y[i] >> x1[i] >> asdasdaadsdasads[i];
    v1.push_back(x[i]);
    v2.push_back(y[i]);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  vans1.push_back(v1[v1.size() - 1]);
  vans2.push_back(v2[v2.size() - 1]);
  long long now = n - 1;
  while (now >= 0) {
    if (v1[now] != vans1[vans1.size() - 1]) {
      vans1.push_back(v1[now]);
      break;
    }
    now--;
  }
  now = n - 1;
  while (now >= 0) {
    if (v2[now] != vans2[vans2.size() - 1]) {
      vans2.push_back(v2[now]);
      break;
    }
    now--;
  }
  for (int i = 0; i < vans1.size(); ++i) {
    for (int j = 0; j < vans2.size(); ++j) {
      long long xans = vans1[i], yans = vans2[j];
      long long val = 0;
      for (int cur = 1; cur <= n; ++cur) {
        if (xans >= x[cur] && xans <= x1[cur] && yans >= y[cur] &&
            yans <= asdasdaadsdasads[cur]) {
          val++;
        }
      }
      if (val >= n - 1) {
        cout << xans << " " << yans << "\n";
        return 0;
      }
    }
  }
  return 0;
}
