#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to, cost;
};
string s;
int main() {
  vector<pair<int, int> > m;
  vector<pair<int, int> > n;
  int N, M;
  while (cin >> M, M) {
    m.clear();
    n.clear();
    int x, y;
    for (int i = (0); i < (M); i++) {
      cin >> x >> y;
      m.push_back(pair<int, int>(x, y));
    }
    sort((m).begin(), (m).end());
    cin >> N;
    for (int i = (0); i < (N); i++) {
      cin >> x >> y;
      n.push_back(pair<int, int>(x, y));
    }
    sort((n).begin(), (n).end());
    for (int i = (0); i < (300); i++)
      n.push_back(pair<int, int>(114514810, 114514810));
    for (int i = (0); i < (N); i++) {
      int dx, dy;
      dx = n[i].first - m[0].first;
      dy = n[i].second - m[0].second;
      for (int j = (0); j < (M); j++) {
        for (int k = (i); k < (N); k++) {
          if (m[j].first + dx == n[k].first &&
              m[j].second + dy == n[k].second) {
            goto next;
          }
        }
        goto end;
      next:;
      }
      cout << dx << " " << dy << endl;
      return 0;
    end:;
    }
  }
}
