#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-12;
const double INF = 1e12;
int main() {
  int m, n;
  while (cin >> m) {
    if (m == 0) break;
    long x, y;
    vector<pair<long, long> > pic, pi;
    for (int i = (0); i < (m); ++i) {
      cin >> x >> y;
      pic.push_back(make_pair(x, y));
    }
    cin >> n;
    for (int i = (0); i < (n); ++i) {
      cin >> x >> y;
      pi.push_back(make_pair(x, y));
    }
    long dx, dy;
    for (int i = (0); i < (n); ++i) {
      dx = pi[i].first - pic[0].first, dy = pi[i].second - pic[0].second;
      bool c = true;
      for (int j = (1); j < (m); ++j) {
        c = false;
        for (int k = (0); k < (n); ++k)
          if (pi[k].first == pic[j].first + dx &&
              pi[k].second == pic[j].second + dy) {
            c = true;
            break;
          }
      }
      if (c) break;
    }
    cout << dx << " " << dy << endl;
  }
  return 0;
}
