#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> cons, stars;
vector<int> luz[1010101];
int m, n;
int main() {
  while (cin >> m, m) {
    cons.clear();
    stars.clear();
    for (int i = 0; i < 1000001; i++) {
      luz[i].clear();
    }
    int x, y;
    cin >> x >> y;
    for (int i = 1; i < m; i++) {
      int nx, ny;
      cin >> nx >> ny;
      cons.push_back(make_pair(nx - x, ny - y));
    }
    cin >> n;
    for (int i = 0; i < n; i++) {
      int nx, ny;
      cin >> nx >> ny;
      luz[nx].push_back(ny);
      stars.push_back(make_pair(nx, ny));
    }
    for (auto &i : stars) {
      int cnt = 0;
      for (auto &j : cons) {
        int nx = i.first + j.first, ny = i.second + j.second;
        if (nx < 0 || ny < 0 || nx > 1000001 || ny > 1000001) continue;
        for (auto &k : luz[nx]) {
          if (k == ny) cnt++;
        }
      }
      if (cnt == cons.size()) {
        cout << i.first - x << " " << i.second - y << endl;
        break;
      }
    }
  }
}
