#include <bits/stdc++.h>
using namespace std;
int a[107], b[107];
int c[107][107];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int m;
  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 flag = 0;
      c[i][j] = a[i] + b[j];
      for (int k = 1; k <= n; ++k) {
        if (c[i][j] == a[k]) {
          flag = 1;
          break;
        }
      }
      for (int l = 1; l <= m; ++l) {
        if (c[i][j] == b[l]) {
          flag = 1;
          break;
        }
      }
      if (!flag) {
        cout << a[i] << " " << b[j];
        return 0;
      }
    }
  }
  return 0;
}
