#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m;
  vector<pair<int, int> > star(m);
  vector<pair<int, int> > d1(m - 1);
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    star[i].first = x;
    star[i].second = y;
    if (i != 0) {
      d1[i - 1].first = star[0].first - star[i].first;
      d1[i - 1].second = star[0].second - star[i].second;
    }
  }
  cin >> n;
  vector<pair<int, int> > pic(n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    pic[i].first = x;
    pic[i].second = y;
  }
  for (int j = 0; j < n; ++j) {
    int cnt = 0;
    bool ok = true;
    for (int i = 0; i < m - 1; ++i) {
      for (int k = 0; k < n; ++k) {
        if ((d1[i].first == (pic[j].first - pic[k].first)) &&
            (d1[i].second == (pic[j].second - pic[k].second))) {
          ++cnt;
          break;
        }
      }
      if (cnt == m - 1) {
        cout << pic[j].first - star[0].first << " "
             << pic[j].second - star[0].second << "\n";
        ok = true;
        break;
      } else {
        ok = false;
      }
    }
    if (ok) {
      break;
    }
  }
  return 0;
}
