#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
int n, m;
int thuoca(int A[], int y) {
  int d = 0;
  for (int i = 1; i <= n; i++) {
    if (A[i] == y) {
      d++;
      break;
    }
  }
  if (d == 0)
    return 0;
  else
    return 1;
}
int thuocb(int B[], int y) {
  int d = 0;
  for (int i = 1; i <= m; i++) {
    if (B[i] == y) {
      d++;
      break;
    }
  }
  if (d == 0)
    return 0;
  else
    return 1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  int x;
  int k = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      x = a[i] + b[j];
      if (thuoca(a, x) == 0 && thuocb(b, x) == 0) {
        k++;
        cout << a[i] << " " << b[j];
        break;
      }
    }
    if (k == 1) break;
  }
  return 0;
}
