#include <bits/stdc++.h>
using namespace std;
int main() {
  while (true) {
    int m, n, x, y;
    vector<pair<int, int> > c;
    vector<pair<int, int> > p;
    vector<pair<int, int> > s;
    cin >> m;
    if (m == 0) break;
    for (int i = 0; i < int(m); i++) {
      cin >> x >> y;
      c.push_back(make_pair(x, y));
    }
    cin >> n;
    for (int i = 0; i < int(n); i++) {
      cin >> x >> y;
      p.push_back(make_pair(x, y));
    }
    sort(c.begin(), c.end());
    sort(p.begin(), p.end());
    int u = 0;
    int v;
    for (int i = 0; i < int(n - m + 1); i++) {
      for (int j = 0; j < int(m - 1); j++) {
        s.push_back(make_pair(p[i].first + c[j + 1].first - c[0].first,
                              p[i].second + c[j + 1].second - c[0].second));
        for (int k = 0; k < int(n); k++) {
          if (p[k] == s[j]) {
            u++;
            break;
          }
        }
      }
      s.clear();
      if (u == m - 1) {
        v = i;
        break;
      }
    }
    cout << p[v].first - c[0].first << " " << p[v].second - c[0].second << endl;
    c.clear();
    p.clear();
  }
  return 0;
}
