#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> sa;
  std::map<int, bool> g1, g2;
  for (int i = 1; i <= n; ++i) {
    int tm;
    std::cin >> tm;
    sa.push_back(tm);
    g1[tm] = true;
  }
  int m;
  std::cin >> m;
  std::vector<int> sb;
  for (int i = 1; i <= m; ++i) {
    int tm;
    std::cin >> tm;
    sb.push_back(tm);
    g2[tm] = true;
  }
  for (auto i1 : sa) {
    for (auto i2 : sb) {
      if (!g1[i1 + i2] && !g2[i1 + i2]) {
        return !(std::cout << i1 << " " << i2 << std::endl);
      }
    }
  }
}
