#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];
  bool ans = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int sum = a[i] + b[j];
      bool t = true;
      for (int k = 0; k < n; k++) {
        t = t && a[k] != sum;
      }
      for (int k = 0; k < m; k++) {
        t = t && b[k] != sum;
      }
      if (t) {
        cout << a[i] << " " << b[j];
        ans = true;
        break;
      }
    }
    if (ans) break;
  }
  return 0;
}
