#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int m;
    cin >> m;
    if (m == 0) {
      break;
    }
    vector<pair<int, int> > basecons;
    int x, y;
    for (int i = 0; i < m; i++) {
      cin >> x >> y;
      basecons.push_back(make_pair(x, y));
    }
    vector<pair<int, int> > allcons;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      allcons.push_back(make_pair(x, y));
    }
    for (int i = 0; i < allcons.size(); i++) {
      int distancex = allcons[i].first - basecons[0].first;
      int distancey = allcons[i].second - basecons[0].second;
      bool isExistCons = false;
      for (int j = 0; j < basecons.size(); j++) {
        bool isExistStar = false;
        if (basecons[j].first + distancex < 0 ||
            basecons[j].first + distancex > 1000000)
          break;
        for (int k = 0; k < allcons.size(); k++) {
          if (allcons[k].first == basecons[j].first + distancex &&
              allcons[k].second == basecons[j].second + distancey) {
            isExistStar = true;
            break;
          } else {
            isExistStar = false;
          }
        }
        if (isExistStar) {
          isExistCons = true;
        } else {
          isExistCons = false;
          break;
        }
      }
      if (isExistCons) {
        cout << distancex << " " << distancey << endl;
        break;
      }
    }
  }
  return 0;
}
