#include <iostream>
#include <unordered_map>
#define REP(i, a, n) for(int i = a; i < n; i++)
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();
    REP(i, 0, m) {
      cin >> s[i].first >> s[i].second;
    }
    cin >> n;
    REP(i, 0, n) {
      cin >> p[i].first >> p[i].second;
      mp[hs(p[i])] = true;
    }

    REP(i, 0, n) {
      d = pair<int, int>(p[i].first - s[0].first, p[i].second - s[0].second);

      REP(j, 1, m) {
        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;
}