#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, ans, j, sum, flag = 0;
  cin >> n;
  int a[n];
  map<int, int> AP, BP;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    AP[a[i]]++;
  }
  cin >> m;
  int b[m];
  for (i = 0; i < m; i++) {
    cin >> b[i];
    BP[b[i]]++;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      sum = a[i] + b[j];
      if (AP[sum] == 0 && BP[sum] == 0) {
        cout << a[i] << " " << b[j];
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  return 0;
}
