#include <bits/stdc++.h>
int main() {
  int a[1000], b[1000];
  int x, y, z, c = 0, d = 0, sum, j, g;
  scanf("%d", &x);
  for (int i = 0; i < x; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &y);
  for (int i = 0; i < y; i++) {
    scanf("%d", &b[i]);
  }
  z = 1;
  for (int g = 0; g < x; g++) {
    for (int j = 0; j < y; j++) {
      z = 1;
      sum = a[g] + b[j];
      for (int m = 0; m < x; m++) {
        if (sum == a[m]) z = 0;
      }
      for (int m = 0; m < y; m++) {
        if (sum == b[m]) z = 0;
      }
      if (z == 1) {
        c = j;
        break;
      }
    }
    if (z == 1) {
      d = g;
      break;
    }
  }
  printf("%d %d", a[d], b[c]);
  return 0;
}
