#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  long long int moto[201];
  long long int ato[1001];
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long int a, b;
    cin >> a >> b;
    moto[i] = a * 1000001 + b;
  }
  cin >> M;
  for (int i = 0; i < M; i++) {
    long long int a, b;
    cin >> a >> b;
    ato[i] = a * 1000001 + b;
  }
  ato[M] = 1000000000000000000;
  sort(ato, ato + M + 1);
  for (int i = 0; i < M; i++) {
    int fg = 1;
    for (int j = 1; j < N; j++) {
      int l = 0, r = M + 1;
      for (int k = 0; k < 12; k++) {
        int mid = (l + r) / 2;
        if (moto[j] - moto[0] <= ato[mid] - ato[i])
          r = mid;
        else
          l = mid;
      }
      if (moto[j] - moto[0] != ato[r] - ato[i] ||
          (moto[j] / 1000001 - moto[0] / 1000001) !=
              (ato[r] / 1000001 - ato[i] / 1000001))
        fg = 0;
    }
    if (fg == 1) {
      cout << (ato[i] / 1000001 - moto[0] / 1000001) << " "
           << (ato[i] % 1000001 - moto[0] % 1000001) << endl;
      break;
    }
  }
  return 0;
}
