#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  int m;
  cin >> m;
  vector<int> b;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    b.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int sum = a[i] + b[j];
      auto it1 = find(a.begin(), a.end(), sum);
      auto it2 = find(b.begin(), b.end(), sum);
      if (it1 == a.end() && it2 == b.end()) {
        cout << a[i] << " " << b[j] << endl;
        return 0;
      }
    }
  }
  return 0;
}
