#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 10;
bool px[M], py[M];
vector<pair<int, int> > tg, stars;
void init(void) {
  memset(px, 0, sizeof(px));
  memset(py, 0, sizeof(py));
  tg.clear();
  stars.clear();
}
bool OK(int dx, int dy) {
  for (auto& t : tg) {
    if (!px[t.first + dx] or !py[t.second + dy]) return false;
  }
  return true;
}
int main() {
  int m, n;
  while (cin >> m && m) {
    init();
    for (int i = (0); i < (int)(m); i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      tg.push_back(make_pair(x, y));
    }
    cin >> n;
    for (int i = (0); i < (int)(n); i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      stars.push_back(make_pair(x, y));
      px[x] = py[y] = true;
    }
    for (auto& star : stars) {
      int diffx = star.first - tg[0].first;
      int diffy = star.second - tg[0].second;
      if (OK(diffx, diffy)) {
        printf("%d %d\n", diffx, diffy);
        goto out;
      }
    }
  out:
    m += 0;
  }
  return 0;
}
