#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, bool> existar;
vector<pair<int, int> > consil, star;
bool center(pair<int, int> s) {
  int x = s.first, y = s.second;
  for (int i = (0); i < (consil.size()); i++)
    if (!existar[pair<int, int>(consil[i].first + x, consil[i].second + y)])
      return false;
  return true;
}
int main() {
  int n, m, fx, fy, tmp, tmpb;
  while (cin >> n && n) {
    existar.clear();
    consil.clear();
    star.clear();
    cin >> fx >> fy;
    for (int i = (0); i < (n - 1); i++) {
      cin >> tmp >> tmpb;
      consil.push_back(pair<int, int>(tmp - fx, tmpb - fy));
    }
    cin >> m;
    for (int i = (0); i < (m); i++) {
      cin >> tmp >> tmpb;
      star.push_back(pair<int, int>(tmp, tmpb));
      existar.insert(map<pair<int, int>, bool>::value_type(
          pair<int, int>(tmp, tmpb), true));
    }
    for (int i = (0); i < (m); i++) {
      if (center(star[i]))
        cout << fx - star[i].first << " " << fy - star[i].second << endl;
    }
  }
  return 0;
}
