#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, t;
  while (1) {
    cin >> n;
    if (n == 0) {
      break;
    }
    vector<pair<int, int> > vec, vec2;
    for (int i = 0; i < n; i++) {
      cin >> s >> t;
      vec.push_back(pair<int, int>(s, t));
    }
    sort(vec.begin(), vec.end());
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> s >> t;
      vec2.push_back(pair<int, int>(s, t));
    }
    sort(vec2.begin(), vec2.end());
    for (int i = 0; i < m; i++) {
      s = vec2[i].first - vec[0].first;
      t = vec2[i].second - vec[0].second;
      int c = 1;
      for (int j = i; j < m && c < 5; j++) {
        if (s == vec2[j].first - vec[c].first &&
            t == vec2[j].second - vec[c].second) {
          c++;
        }
      }
      if (c == n) {
        cout << s << " " << t << endl;
        break;
      }
    }
  }
  return 0;
}
