#include <bits/stdc++.h>
using namespace std;
int vis[405], a[105], b[105];
int main() {
  int n, m;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    vis[a[i]] = true;
  }
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &b[i]);
    vis[b[i]] = true;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (!vis[a[i] + b[j]]) {
        printf("%d %d\n", a[i], b[j]);
        exit(0);
      }
    }
  }
  return 0;
}
