#include <bits/stdc++.h>
int m, n;
std::vector<std::pair<int, int>> mxy, nxy;
int main() {
  std::cin >> m;
  for (int i = 0; i < m; ++i) {
    int x, y;
    std::cin >> x >> y;
    mxy.push_back({x, y});
  }
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    int x, y;
    std::cin >> x >> y;
    nxy.push_back({x, y});
  }
  std::sort(nxy.begin(), nxy.end());
  std::sort(mxy.begin(), mxy.end());
  for (auto i : nxy) {
    auto dif_x = i.first - mxy[0].first;
    auto dif_y = i.second - mxy[0].second;
    bool flag = true;
    for (auto j : mxy) {
      auto iter =
          std::lower_bound(nxy.begin(), nxy.end(),
                           std::make_pair(j.first + dif_x, j.second + dif_y));
      if (iter != nxy.end()) {
        if (*iter != std::make_pair(j.first + dif_x, j.second + dif_y)) {
          flag = false;
          break;
        }
      }
    }
    if (flag) {
      std::cout << dif_x << " " << dif_y << std::endl;
      return 0;
    }
  }
}
