#include <bits/stdc++.h>
int main() {
  int i, j, k, find_star, find_cons, consnum, starnum, x_offset, y_offset;
  while (1) {
    scanf("%d", &consnum);
    if (consnum == 0) break;
    int consx[consnum], consy[consnum];
    for (i = 0; i < consnum; i++) {
      scanf("%d %d", &consx[i], &consy[i]);
    }
    scanf("%d", &starnum);
    int starx[starnum], stary[starnum];
    for (i = 0; i < starnum; i++) {
      scanf("%d %d", &starx[i], &stary[i]);
    }
    for (i = 0; i < starnum; i++) {
      x_offset = starx[i] - consx[0];
      y_offset = stary[i] - consx[0];
      find_cons = 0;
      for (j = 1; j < consnum; j++) {
        find_star = 0;
        for (k = 0; k < starnum; k++) {
          if (starx[k] - x_offset == consx[j] &&
              stary[k] - y_offset == consy[j]) {
            find_star = 1;
            break;
          }
        }
        if (find_star == 0) {
          break;
        }
      }
      if (j == consnum - 1) {
        printf("%d %d\n", x_offset, y_offset);
        find_cons = 1;
      }
      if (find_cons = 1) {
        break;
      }
    }
  }
}
