#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const long long mod = 1e9 + 7;
set<int> a, b;
int main() {
  int n, m;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    a.insert(t);
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    int t;
    cin >> t;
    b.insert(t);
  }
  for (set<int>::iterator i = a.begin(); i != a.end(); i++) {
    for (set<int>::iterator j = b.begin(); j != b.end(); j++) {
      int t = *i + *j;
      if (a.find(t) == a.end() && b.find(t) == b.end()) {
        cout << *i << " " << *j << endl;
        return 0;
        ;
      }
    }
  }
  return 0;
}
