#include <bits/stdc++.h>
using namespace std;
int n;
int x1[200000], x2[200000], yy1[200000], yy2[200000];
int x12 = INT_MIN, x22 = INT_MAX, yy12 = INT_MIN, yy22 = INT_MAX;
int x13 = INT_MIN, x23 = INT_MAX, yy13 = INT_MIN, yy23 = INT_MAX;
bool check(int a, int b) {
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a >= x1[i] && a <= x2[i] && b >= yy1[i] && b <= yy2[i]) cnt++;
  }
  if (cnt >= n - 1) {
    printf("%d %d", a, b);
    return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d%d", &x1[i], &yy1[i], &x2[i], &yy2[i]);
  }
  for (int i = 0; i < n; i++) {
    if (x1[i] > x12) x12 = x1[i];
    if (x2[i] < x22) x22 = x2[i];
    if (yy1[i] > yy12) yy12 = yy1[i];
    if (yy2[i] < yy22) yy22 = yy2[i];
  }
  for (int i = 0; i < n; i++) {
    if (x1[i] > x13 && x1[i] != x12) x13 = x1[i];
    if (x2[i] < x23 && x2[i] != x22) x23 = x2[i];
    if (yy1[i] > yy13 && yy1[i] != yy12) yy13 = yy1[i];
    if (yy2[i] < yy23 && yy2[i] != yy22) yy23 = yy2[i];
  }
  if (x13 == INT_MIN) x13 = x12;
  if (yy13 == INT_MIN) yy13 = yy12;
  if (x23 == INT_MAX) x23 = x22;
  if (yy23 == INT_MAX) yy23 = yy22;
  if (check(x12, yy12)) return 0;
  if (check(x13, yy12)) return 0;
  if (check(x22, yy12)) return 0;
  if (check(x23, yy12)) return 0;
  if (check(x12, yy13)) return 0;
  if (check(x13, yy13)) return 0;
  if (check(x22, yy13)) return 0;
  if (check(x23, yy13)) return 0;
  if (check(x12, yy22)) return 0;
  if (check(x13, yy22)) return 0;
  if (check(x22, yy22)) return 0;
  if (check(x23, yy22)) return 0;
  if (check(x12, yy23)) return 0;
  if (check(x13, yy23)) return 0;
  if (check(x22, yy23)) return 0;
  if (check(x23, yy23)) return 0;
}
