#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  cin >> m;
  vector<int> b(m);
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      bool ok = 1;
      for (int k = 0; k < m; ++k) {
        if (b[k] == a[i] + b[j]) {
          ok = 0;
          break;
        }
      }
      for (int k = 0; k < n; ++k) {
        if (a[k] == a[i] + b[j]) {
          ok = 0;
          break;
        }
      }
      if (ok) {
        cout << a[i] << " " << b[j];
        return 0;
      }
    }
  }
  return 0;
}
