#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int m;
  cin >> m;
  int b[m + 1];
  for (int i = 1; i <= m; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int l = 0;
      int s = a[i] + b[j];
      for (int k = 1; k <= n; k++)
        if (a[k] == s) {
          k = n + 1;
          l = 1;
        }
      for (int k = 1; k <= m; k++)
        if (b[k] == s) {
          k = m + 1;
          l = 1;
        }
      if (l == 0) {
        cout << a[i] << " " << b[j];
        i = n + 1;
        j = m + 1;
      }
    }
  }
  return 0;
}
