#include <bits/stdc++.h>
using namespace std;
int sear(int x, int n, int A[], int m, int B[]) {
  int i;
  for (i = 0; i < n; i++) {
    if (x == A[i]) return 1;
  }
  for (i = 0; i < m; i++) {
    if (x == B[i]) return 1;
  }
  return 0;
}
int main() {
  int n, m, i, j, flag;
  int A[500], B[500];
  cin >> n;
  for (i = 0; i < n; i++) cin >> A[i];
  cin >> m;
  for (i = 0; i < m; i++) cin >> B[i];
  flag = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (sear(A[i] + B[j], n, A, m, B) == 0) {
        flag = 1;
        cout << A[i] << " " << B[j];
        break;
      }
    }
    if (flag == 1) break;
  }
}
