#include <bits/stdc++.h>
using namespace std;
int a[110], b[110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int aa = a[n];
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> b[i];
  sort(b + 1, b + 1 + n);
  int bb = b[n];
  cout << aa << " " << bb << endl;
}
