#include <bits/stdc++.h>
using namespace std;
int n, m;
void solve() {
  vector<pair<int, int> > model(n);
  vector<pair<int, int> > dist(n);
  for (int i = 0; i < n; i++) cin >> model[i].first >> model[i].second;
  for (int i = 0; i < n; i++) {
    dist[i] = pair<int, int>(model[0].first - model[i].first,
                             model[0].second - model[i].second);
  }
  sort(dist.begin(), dist.end());
  cin >> m;
  vector<pair<int, int> > some(m);
  for (int j = 0; j < m; j++) {
    cin >> some[j].first >> some[j].second;
  }
  for (int i = 0; i < m; i++) {
    int c = 0;
    for (int j = 0; j < m; j++) {
      pair<int, int> sdist = pair<int, int>(some[i].first - some[j].first,
                                            some[i].second - some[j].second);
      if (binary_search(dist.begin(), dist.end(), sdist)) {
        c++;
      }
    }
    if (c == n) {
      cout << some[0].first - model[0].first << ' '
           << some[i].second - model[0].second << endl;
      break;
    }
  }
}
int main(void) {
  while (cin >> n, n) solve();
  return 0;
}
