#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n, n != 0) {
    vector<pair<int, int> > c, p;
    int m;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      c.push_back(make_pair(x, y));
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
      int x, y;
      cin >> x >> y;
      p.push_back(make_pair(x, y));
    }
    sort(c.begin(), c.end());
    sort(p.begin(), p.end());
    bool isFind = true;
    int dx, dy;
    int cSize = c.size(), pSize = p.size();
    for (int i = 0; i < pSize; i++) {
      dx = p[i].first - c[0].first;
      dy = p[i].second - c[0].second;
      for (int j = 1; j < cSize; j++) {
        if (!binary_search(p.begin(), p.end(),
                           make_pair(c[j].first + dx, c[j].second + dy))) {
          isFind = false;
          break;
        }
      }
      if (isFind) {
        cout << dx << " " << dy << endl;
        break;
      }
    }
  }
}
