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