#include <bits/stdc++.h>
using namespace std;
long long int arr1[1000];
long long int arr2[1000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  sort(arr1, arr1 + n);
  cin >> m;
  for (long long int i = 0; i < m; i++) {
    cin >> arr2[i];
  }
  sort(arr2, arr2 + m);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      long long int s = arr1[i] + arr2[j];
      long long int b1 = binary_search(arr1, arr1 + n, s);
      long long int b2 = binary_search(arr2, arr2 + m, s);
      if (b1 == 0 && b2 == 0) {
        cout << arr1[i] << " " << arr2[j] << endl;
        return 0;
      }
    }
  }
  return 0;
}
