#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > s;
pair<int, int> seiza[101];
pair<int, int> sky[1001];
int m, n, x, y, dx, dy;
int main() {
  while (1) {
    scanf("%d", &m);
    if (!m) return 0;
    s.clear();
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &seiza[i].first, &seiza[i].second);
    }
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &x, &y);
      s.insert(pair<int, int>(x, y));
    }
    set<pair<int, int> >::iterator ite;
    for (ite = s.begin(); ite != s.end(); ++ite) {
      pair<int, int> a = *ite;
      pair<int, int> p = a;
      for (int i = 0; i < m - 1; i++) {
        dx = seiza[i + 1].first - seiza[i].first;
        dy = seiza[i + 1].second - seiza[i].second;
        if (s.count(pair<int, int>(p.first + dx, p.second + dy)) == 0) goto en;
        p.first += dx;
        p.second += dy;
      }
      printf("%d %d\n", -seiza[0].first + a.first, -seiza[0].second + a.second);
      break;
    en:;
    }
  }
}
