#include <bits/stdc++.h>
using namespace std;
const int N = 5002;
int mn = 1e9;
bool was[N];
int n, m, a[N], b[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    was[a[i]] = true;
  }
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
    was[b[i]] = true;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (!was[a[i] + b[j]]) {
        return cout << a[i] << ' ' << b[j], 0;
      }
    }
  }
  return 0;
}
