#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  while (cin >> m && m) {
    vector<int> sx(m), sy(m);
    for (int i = 0; i < m; i++) {
      cin >> sx[i] >> sy[i];
    }
    cin >> n;
    vector<int> fx(n), fy(n);
    for (int i = 0; i < n; i++) {
      cin >> fx[i] >> fy[i];
    }
    int ans[2];
    ans[0] = ans[1] = -1;
    for (int s = 0; s < n; s++) {
      bool ok = true;
      int dx = fx[s] - sx[0], dy = fy[s] - sy[0];
      for (int i = 0; i < m; i++) {
        bool f = false;
        int nx = dx + sx[i], ny = dy + sy[i];
        for (int j = 0; j < n; j++) {
          if (nx == fx[j] && ny == fy[j]) f = true;
        }
        if (!f) {
          ok = false;
          break;
        }
      }
      if (ok) {
        ans[0] = dx;
        ans[1] = dy;
        break;
      }
    }
    cout << ans[0] << endl << ans[1] << endl;
  }
}
