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