#include <bits/stdc++.h>
const int INF = 1 << 24;
void inputStars(int star_n, std::vector<std::pair<int, int> >& pv) {
  for (int i = 0; i < star_n; i++) {
    int first, second;
    std::cin >> first >> second;
    pv.push_back(std::make_pair(first, second));
  }
}
void toAbsolute(std::vector<std::pair<int, int> >& pv) {
  for (int i = 1; i < pv.size(); i++) {
    pv[i].first -= pv[0].first;
    pv[i].second -= pv[0].second;
  }
}
int main() {
  int n, m;
  auto compareP = [](const std::pair<int, int>& lp,
                     const std::pair<int, int>& rp) -> bool {
    return lp.first < rp.first || lp.second < rp.second;
  };
  while (std::cin >> n, n) {
    std::vector<std::pair<int, int> > cv, sv;
    inputStars(n, cv);
    std::sort(cv.begin(), cv.end(), compareP);
    toAbsolute(cv);
    std::cin >> m;
    inputStars(m, sv);
    std::sort(sv.begin(), sv.end(), compareP);
    std::pair<int, int> res = std::make_pair(INF, INF);
    for (int i = 0; i < sv.size() && (res.first == INF); i++) {
      bool isMatched = true;
      for (int j = 1; j < cv.size(); j++) {
        int x = sv[i].first + cv[j].first, y = sv[i].second + cv[j].second;
        if (std::find(sv.begin(), sv.end(), std::make_pair(x, y)) != sv.end()) {
        } else {
          isMatched = false;
          break;
        }
      }
      if (isMatched) {
        res = std::make_pair(sv[i].first - cv[0].first,
                             sv[i].second - cv[0].second);
      }
    }
    std::cout << res.first << " " << res.second << std::endl;
  }
  return 0;
}
