#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> m;
  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++) {
      for (int g = 0; g < n; g++) {
        if (a[i] + b[j] != a[g]) {
          c++;
        }
      }
      for (int h = 0; h < m; h++) {
        if (a[i] + b[j] != b[h]) {
          c++;
        }
      }
      if (c == n + m) {
        cout << a[i] << " " << b[j];
        return 0;
      } else {
        c = 0;
      }
    }
  }
  return 0;
}
