#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll m, n, ansx, ansy;
  map<P, bool> ch;
  while(cin >> m, m) {
    ansx = 0, ansy = 0;
    P s[m];
    ch.clear();
    rep(i, m) cin >> s[i].first >> s[i].second;
    cin >> n;
    P h[n];
    rep(i, n) {
      cin >> h[i].first >> h[i].second;
      ch[h[i]] = true;
    }
    rep(i, n) {
      ll j;
      ll xx = h[i].first - s[0].first;
      ll yy = h[i].second - s[0].second;
      for(j = 0; j < m; j++) {
        P p = P(s[j].first + xx, s[j].second + yy);
        if(!ch[p]) break;
        if(j == m - 1) ansx = xx, ansy = yy;
      }
    }
    cout << ansx << " " << ansy << endl;
  }
	return 0;
}
