#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long int n;
  cin >> n;
  vector<long long int> a(n), ca(500);
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
    ca[a[i]]++;
  }
  long long int m;
  cin >> m;
  vector<long long int> b(m), cb(500);
  for (long long int i = 0; i < m; ++i) {
    cin >> b[i];
    cb[b[i]]++;
  }
  for (long long int i = 0; i < n; ++i) {
    for (long long int j = 0; j < m; ++j) {
      if (ca[a[i] + b[j]] == 0 && cb[a[i] + b[j]] == 0) {
        cout << a[i] << ' ' << b[j];
        return 0;
      }
    }
  }
}
