#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int m, n;
  while (cin >> m && m > 0) {
    vector<pair<int, int> > c(m);
    for (int i = 0; i < m; i++) {
      cin >> c[i].first >> c[i].second;
    }
    for (int i = 0; i < m - 1; i++) {
      c[i + 1].first -= c[0].first;
      c[i + 1].second -= c[0].second;
    }
    cin >> n;
    vector<pair<int, int> > s(n);
    map<pair<int, int>, bool> M;
    for (int i = 0; i < n; i++) {
      cin >> s[i].first >> s[i].second;
      M[s[i]] = 1;
    }
    for (int i = 0; i < n; i++) {
      bool f = 1;
      int x = s[i].first, y = s[i].second;
      for (int k = 1; k <= m - 1; k++) {
        pair<int, int> p;
        p.first = c[i].first + x;
        p.second = c[i].second + y;
        if (M[p] != 1) {
          f = 0;
          break;
        }
      }
      if (f) {
        cout << x - c[0].first << " " << y - c[0].second << endl;
        break;
      }
    }
  }
  return 0;
}
