#include <bits/stdc++.h>
using namespace std;
const int64_t N = 2e5;
int64_t a[N], b[N];
int main() {
  int64_t n, m;
  vector<int64_t> v1, v2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int64_t x;
    cin >> x;
    v1.push_back(x);
    a[x]++;
  }
  cin >> m;
  for (int j = 0; j < m; j++) {
    int64_t x;
    cin >> x;
    v2.push_back(x);
    b[x]++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int64_t x = v1[i] + v2[j];
      if (a[x] == 0 and b[x] == 0) {
        cout << v1[i] << " " << v2[j];
        return 0;
      }
    }
  }
}
