#include <bits/stdc++.h>
using namespace std;
const int NUM = 132679;
const int mod = 1e9 + 7;
const int INF = 1e9 + 50;
pair<int, int> pinf = {INF, INF};
int l[NUM], r[NUM], u[NUM], d[NUM];
pair<int, int> inter(int ind, int n) {
  int l1 = -INF, d1 = -INF;
  int r1 = INF, u1 = INF;
  for (int i = 0; i < n; i++)
    if (i != ind) {
      l1 = max(l1, l[i]);
      r1 = min(r1, r[i]);
      d1 = max(d1, d[i]);
      u1 = min(u1, u[i]);
    }
  if (l1 > r1 || d1 > u1) return pinf;
  return {l1, d1};
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i] >> d[i] >> r[i] >> u[i];
  int curl = 0, curr = 0, curd = 0, curu = 0;
  for (int i = 1; i < n; i++) {
    if (l[i] > l[curl]) curl = i;
    if (r[curr] > r[i]) curr = i;
    if (u[curu] > u[i]) curu = i;
    if (d[curd] < d[i]) curd = i;
  }
  auto ans1 = inter(curl, n);
  auto ans2 = inter(curr, n);
  auto ans3 = inter(curu, n);
  auto ans4 = inter(curd, n);
  if (ans1 != pinf) {
    cout << ans1.first << ' ' << ans1.second;
    return 0;
  }
  if (ans2 != pinf) {
    cout << ans2.first << ' ' << ans2.second;
    return 0;
  }
  if (ans3 != pinf) {
    cout << ans3.first << ' ' << ans3.second;
    return 0;
  }
  if (ans4 != pinf) {
    cout << ans4.first << ' ' << ans4.second;
    return 0;
  }
  return 0;
}
