#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int na, nb;
int vis[500];
int a[200 + 5], b[200 + 5];
int main() {
  int i;
  cin >> na;
  for (i = 1; i <= na; i++) cin >> a[i];
  sort(a + 1, a + na + 1);
  cin >> nb;
  for (i = 1; i <= nb; i++) cin >> b[i];
  sort(b + 1, b + nb + 1);
  cout << a[na] << " " << b[nb] << endl;
}
