#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[110], b[110];
int chka[110], chkb[110];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    chka[a[i]] = 1;
  }
  scanf("%d", &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &b[i]);
    chkb[b[i]] = 1;
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      int now = a[i] + b[j];
      if (!chka[now] && !chkb[now]) {
        printf("%d %d", a[i], b[j]);
        return 0;
      }
    }
  }
  return 0;
}
