#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  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<int> y_of[1000001];
  vector<pair<int, int> > allcons;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    y_of[x].push_back(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) continue;
      for (int k = 0; k < y_of[basecons[j].first + distancex].size(); k++) {
        if (y_of[basecons[j].first + distancex][k] ==
            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;
}
