#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n;
  vector<int> a(n);
  int vis[500] = {};
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    vis[a[i]]++;
  }
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    vis[b[i]]++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vis[a[i] + b[j]] == 0) {
        cout << a[i] << " " << b[j] << endl;
        return;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
