#include <bits/stdc++.h>
using namespace std;
map<int, int> arra;
map<int, int> arrb;
int main() {
  int t, r, e, a[300], b[300];
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i];
    arra[a[i]] = 1;
  }
  cin >> r;
  for (int i = 0; i < r; i++) {
    cin >> b[i];
    arrb[b[i]] = 1;
  }
  for (int i = 0; i < t; i++) {
    for (int j = 0; j < r; j++) {
      int d = a[i] + b[j];
      if (arra[d] == 0 && arrb[d] == 0) {
        printf("%d %d\n", a[i], b[j]);
        return 0;
      }
    }
  }
  return 0;
}
