#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> all;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    all.insert(a[i]);
  }
  int m;
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    all.insert(b[i]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (all.count(a[i] + b[j]) == 0) {
        cout << a[i] << " " << b[j] << endl;
        return 0;
      }
    }
  }
  return 0;
}
