#include <bits/stdc++.h>
using namespace std;
const long long mos = 0x7FFFFFFFLL;
const long long nmos = 0x80000000LL;
const int inf = 0x3f3f3f3f;
const long long inff = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos(-1.0);
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
const int maxn = 150090;
struct area {
  long long x1, y1, x2, y2;
  unsigned long long s;
} a[maxn];
bool cmp(area w, area q) { return w.s < q.s; }
multiset<long long> sa, sb, sc, sd;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x1 >> a[i].y1 >> a[i].x2 >> a[i].y2;
    a[i].s = 1ull * (a[i].y2 - a[i].y1) * (a[i].x2 - a[i].x1);
    sa.insert(a[i].x1);
    sb.insert(a[i].y1);
    sc.insert(a[i].x2);
    sd.insert(a[i].y2);
  }
  for (int i = 1; i <= n; i++) {
    sa.erase(sa.find(a[i].x1));
    sb.erase(sb.find(a[i].y1));
    sc.erase(sc.find(a[i].x2));
    sd.erase(sd.find(a[i].y2));
    long long xz = *sa.rbegin();
    long long xy = *sc.begin();
    long long ys = *sd.begin();
    long long yx = *sb.rbegin();
    if (xz <= xy && yx <= ys) {
      cout << xz << " " << yx << endl;
      return 0;
    }
    sa.insert(a[i].x1);
    sb.insert(a[i].y1);
    sc.insert(a[i].x2);
    sd.insert(a[i].y2);
  }
  return 0;
}
