#include <bits/stdc++.h>
using namespace std;
const int Maxn = 101;
int n, m, a[Maxn], b[Maxn];
set<int> sa, sb;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i], sa.insert(a[i]);
  cin >> m;
  for (int i = 1; i <= m; ++i) cin >> b[i], sb.insert(b[i]);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      int tmp = a[i] + b[j];
      if (sa.count(tmp) == 0 && sb.count(tmp) == 0) {
        cout << a[i] << ' ' << b[j] << endl;
        return 0;
      }
    }
  return 0;
}
