#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> m && m) {
    vector<pair<long long, long long> > target(m);
    for (int i = 0; i < m; i++) cin >> target[i].first >> target[i].second;
    cin >> n;
    vector<pair<long long, long long> > night(n);
    for (int i = 0; i < n; i++) cin >> night[i].first >> night[i].second;
    sort(night.begin(), night.end());
    sort(target.begin(), target.end());
    for (int i = 0; i < n; i++) {
      bool flag = false;
      pair<long long, long long> d = make_pair(
          target[0].first - night[i].first, target[0].second - night[i].second);
      for (int j = 1; j < m; j++) {
        if (!binary_search(night.begin(), night.end(),
                           make_pair(target[j].first - d.first,
                                     target[j].second - d.second)))
          break;
        else if (j == m - 1) {
          cout << d.first << " " << d.second << endl;
          ;
          flag = true;
          break;
        }
      }
      if (flag) break;
    }
  }
}
