#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, m, ans;
int a[101], b[101];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> m;
  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 f = 1;
      for (int k = 1; k <= n; k++)
        if (a[k] == a[i] + b[j]) f = 0;
      for (int k = 1; k <= m; k++)
        if (b[k] == a[i] + b[j]) f = 0;
      if (f) {
        cout << a[i] << " " << b[j] << endl;
        return 0;
      }
    }
  return 0;
}
