#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  int A[n];
  unordered_map<int, int> M;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    M[A[i]] = 1;
  }
  cin >> m;
  int B[m];
  for (int i = 0; i < m; i++) {
    cin >> B[i];
    M[B[i]] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int sum = A[i] + B[j];
      if (M.find(sum) == M.end()) {
        cout << A[i] << " " << B[j];
        return 0;
      }
    }
  }
  return 0;
}
