#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int n, i, m, x = 0, y = 0, j, k;
    cin >> n;
    if (n == 0) return 0;
    vector<pair<int, int>> va(n + 5);
    for (i = 0; i < n; i++) {
      int a, b;
      cin >> a >> b;
      va[i].first = a;
      va[i].second = b;
    }
    cin >> m;
    vector<pair<int, int>> vb(m + 5);
    for (i = 0; i < m; i++) {
      int a, b;
      cin >> a >> b;
      vb[i].first = a;
      vb[i].second = b;
    }
    for (i = 0; i < m; i++) {
      x = vb[i].first - va[0].first;
      y = vb[i].second - va[0].second;
      int count = 0;
      for (j = 0; j < n; j++) {
        for (k = 0; k < m; k++) {
          if (vb[k].first == va[j].first + x &&
              vb[k].second == va[j].second + y) {
            count++;
          }
        }
      }
      if (count == n) {
        cout << x << " " << y << endl;
      }
    }
  }
  return 0;
}
