#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  long long n, m, p, t;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  long long b[m];
  for (long long i = 0; i < m; i++) cin >> b[i];
  set<long long> x(a, a + n);
  set<long long> y(b, b + m);
  for (auto i = x.begin(); i != x.end(); i++) {
    for (auto j = y.begin(); j != y.end(); j++) {
      t = 0;
      p = *i + *j;
      for (auto k = x.begin(); k != x.end(); k++) {
        if (p == *k) {
          t++;
          break;
        }
      }
      if (t == 0) {
        for (auto k = y.begin(); k != y.end(); k++) {
          if (p == *k) {
            t++;
            break;
          }
        }
      }
      if (t == 0) {
        cout << *i << " " << *j;
        return 0;
      }
    }
  }
}
