#include <bits/stdc++.h>
using namespace std;
struct cood {
  int x, y;
};
bool comp(const cood& a, const cood& b) { return a.x < b.x; }
cood star[200], star2[1000];
cood diff[1000][200];
int main() {
  int m, n;
  while (scanf("%d", &m) && m != 0) {
    for (int i = 0; i < m; i++) scanf("%d%d", &star[i].x, &star[i].y);
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      star2[i] = (cood){x, y};
      for (int j = 0; j < m; j++) {
        diff[i][j] = (cood){x - star[j].x, y - star[j].y};
      }
    }
    sort(star2, star2 + n, comp);
    int dx = 0, dy = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        bool flag = true;
        for (int k = 0; k < m; k++) {
          if (k == j) continue;
          int x = star[k].x + diff[i][j].x, y = star[k].y + diff[i][j].y;
          flag = false;
          for (int l = 0; l < n; l++) {
            if (x == star2[l].x && y == star2[l].y) {
              flag = true;
              break;
            }
          }
          if (!flag) break;
        }
        if (flag) {
          dx = diff[i][j].x;
          dy = diff[i][j].y;
          break;
        }
      }
    }
    printf("%d %d\n", dx, dy);
  }
}
