#include <bits/stdc++.h>
using namespace std;
int m, n;
pair<int, int> s[200], p[1000], d, r;
unordered_map<long, bool> mp;
long hs(pair<int, int> z) { return (long)z.first * 1000001 + z.second; }
bool at(pair<int, int> z) {
  return 0 <= z.first && z.first <= 1000000 && 0 <= z.second &&
         z.second <= 1000000;
}
int main(void) {
  while (cin >> m, m != 0) {
    mp.clear();
    for (int i = 0; i < m; i++) {
      cin >> s[i].first >> s[i].second;
    }
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> p[i].first >> p[i].second;
      mp[hs(p[i])] = true;
    }
    for (int i = 0; i < n; i++) {
      d = pair<int, int>(p[i].first - s[0].first, p[i].second - s[0].second);
      for (int j = 1; j < m; j++) {
        r = pair<int, int>(s[j].first + d.first, s[j].second + d.second);
        if (!(at(r) && mp[hs(r)])) goto CONT;
      }
      cout << d.first << " " << d.second << endl;
      goto NEXT;
    CONT:;
    }
  NEXT:;
  }
  return 0;
}
