#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  int m;
  cin >> m;
  int y[m];
  for (int i = 0; i < m; i++) cin >> y[i];
  int sum, c;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      c = 0;
      sum = x[i] + y[j];
      for (int i = 0; i < n; i++) {
        if (sum == x[i]) c++;
      }
      for (int i = 0; i < m; i++) {
        if (sum == y[i]) c++;
      }
      if (c == 0) {
        cout << x[i] << " " << y[j];
        break;
      }
    }
    if (c == 0) break;
  }
}
