#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
inline int read() {
  int sum = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum * f;
}
int n, m, a[N], b[N];
map<int, bool> vis1, vis2;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    vis1[a[i]] = 1;
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    vis2[b[i]] = 1;
  }
  bool flag = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!vis1[a[i] + b[j]] && !vis2[a[i] + b[j]]) {
        cout << a[i] << ' ' << b[j] << '\n';
        flag = 1;
        break;
      }
    }
    if (flag) break;
  }
  return 0;
}
