#include <bits/stdc++.h>
int star;
int num;
long long int x[200] = {};
long long int y[200] = {};
long long int place[200] = {};
long long int pic_x[1000] = {};
long long int pic_y[1000] = {};
long long int pic_place[1000] = {};
long long int box;
long long int ans_x;
long long int ans_y;
void search(int start, int dis, int fig) {
  for (int i = start; i < num && pic_place[i] <= pic_place[start] + dis; i++) {
    if (pic_place[start] + dis == pic_place[i]) {
      if (fig + 2 == star) {
        ans_x = pic_place[i] / 1000001 - place[star - 1] / 1000001;
        ans_y = pic_place[i] % 1000001 - place[star - 1] % 1000001;
        return;
      }
      search(i, place[fig + 2] - place[fig + 1], fig + 1);
    }
  }
  return;
}
int main() {
  scanf("%d", &star);
  while (star != 0) {
    for (int i = 0; i < star; i++) {
      scanf("%lld %lld", &x[i], &y[i]);
    }
    for (int i = 0; i < star; i++) {
      place[i] = x[i] * 1000001 + y[i];
    }
    for (int i = 0; i < star - 1; i++) {
      for (int j = i; j < star; j++) {
        if (place[i] > place[j]) {
          box = place[i];
          place[i] = place[j];
          place[j] = box;
        }
      }
    }
    scanf("%d", &num);
    for (int i = 0; i < num; i++) {
      scanf("%lld %lld", &pic_x[i], &pic_y[i]);
    }
    for (int i = 0; i < num; i++) {
      pic_place[i] = pic_x[i] * 1000001 + pic_y[i];
    }
    for (int i = 0; i < num - 1; i++) {
      for (int j = i; j < num; j++) {
        if (pic_place[i] > pic_place[j]) {
          box = pic_place[i];
          pic_place[i] = pic_place[j];
          pic_place[j] = box;
        }
      }
    }
    for (int i = 0; i < num - star; i++) {
      search(i, place[1] - place[0], 0);
    }
    printf("%lld %lld\n", ans_x, ans_y);
    scanf("%d", &star);
  }
  return 0;
}
